Post by nickelaj » Sun May 03, 2020 9:00 pm

Hi,
I am using 3.0.3.2 version opencart and not default template.
I have a problem for search page. When i search a word includes Turkish characters like "ürün" first search page is working exactly but pagination links goes to not coded utf-8 link. Checked php.ini, htacess, files utf-8 without bom but couldn't solve this.
Can you give advice ?
Regards and wish healthy days.

Search first page is :
........&search=ürün&submit_search=&route=product%2Fsearch&description=true
Pagination link is :
.......search=%25C3%25BCr%25C3%25BCn&description=true&category_id=0&page=2
Last edited by nickelaj on Mon May 04, 2020 8:48 pm, edited 1 time in total.

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by straightlight » Sun May 03, 2020 9:49 pm

Checked php.ini, htaccess, files utf-8 without bom but couldn't solve this.
Have you checked .user.ini file and ensure, either, php.ini or .user.ini file do not end with semi-colon at the end of each lines? Is the:

Code: Select all

default_charset	= UTF-8
also implicit in your php.ini or .user.ini file?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nickelaj » Sun May 03, 2020 10:06 pm

straightlight wrote:
Sun May 03, 2020 9:49 pm
Checked php.ini, htaccess, files utf-8 without bom but couldn't solve this.
have you checked .user.ini file and ensure, either, php.ini or .user.ini file do not end with semi-colon at the end of each lines? Is the:

Code: Select all

default_charset	= UTF-8
also implicit in your php.ini or .user.ini file?
Exactly checked all .ini files . There are no any semi colons either. Only this character coding problem occurs for search pagination. I have no seo module.

Code: Select all

magic_quotes_gpc = Off
register_globals = Off
default_charset	= UTF-8
memory_limit = 512M
max_execution_time = 36000
upload_max_filesize = 999M
safe_mode = Off
mysql.connect_timeout = 20
session.auto_start = Off
session.use_only_cookies = On
session.use_cookies = On
session.use_trans_sid = Off
session.cookie_httponly = On
session.gc_maxlifetime = 3600
allow_url_fopen = On

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by straightlight » Sun May 03, 2020 10:11 pm

Please provide your URL.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Sun May 03, 2020 10:27 pm

Let's try this (untested since I don't use the Turkish language).

In your catalog/controller/product/search.php file,

find all instances of:

Code: Select all

urlencode
replace all with:

Code: Select all

utf8_encode
See if that solves the issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nickelaj » Sun May 03, 2020 10:42 pm

straightlight wrote:
Sun May 03, 2020 10:27 pm
Let's try this (untested since I don't use the Turkish language).

In your catalog/controller/product/search.php file,

find all instances of:

Code: Select all

urlencode
replace all with:

Code: Select all

utf8_encode
See if that solves the issue.
Unfortunately it didn't solved.
My web link is below. You can see search word is "granül" in the link. When you go page 2 from pagination it shows hover link true but goes to word "gran%25C3%25BCl" . utf8_encode made the link like this at first page.

First Page :

https://www.mysite.com/index.php?catego ... ption=true

Linked Page 2
https://www.mysite.com/index.php?route= ... rue&page=2
Last edited by nickelaj on Fri May 08, 2020 1:32 am, edited 1 time in total.

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by ADD Creative » Mon May 04, 2020 12:58 am

Try disabling your search extension to see if the problem goes away.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by nickelaj » Mon May 04, 2020 1:11 am

ADD Creative wrote:
Mon May 04, 2020 12:58 am
Try disabling your search extension to see if the problem goes away.
Changed {{autosearch}} to {{search}} for default search . Still same problem.
I think there is bug there. Search box input sends not encoded characters

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by ADD Creative » Mon May 04, 2020 2:32 am

That's not fully disabling the extension.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by nickelaj » Mon May 04, 2020 2:54 am

ADD Creative wrote:
Mon May 04, 2020 2:32 am
That's not fully disabling the extension.
Disabled from extensions, removed from modifications. And for exact solution changed header search from default template.
Still same. It was not enough for me, backed up my catalog folder and uploaded default template catalog folder. It didn't changed. Removed vqmod cache files.
So i started to think is there any problem for system folder files. Thinking for hours.

Why getting "granül" search word is going "gran%C3%BCl" for breadcrumb or pagination link exactly can't understand.

Code: Select all

http://www.mysite.com/index.php?route=product/search&search=gran%C3%BCl&description=true&category_id=0&sub_category=true">
Last edited by nickelaj on Fri May 08, 2020 1:33 am, edited 1 time in total.

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by straightlight » Mon May 04, 2020 3:10 am

nickelaj wrote:
Mon May 04, 2020 2:54 am
ADD Creative wrote:
Mon May 04, 2020 2:32 am
That's not fully disabling the extension.
Disabled from extensions, removed from modifications. And for exact solution changed header search from default template.
Still same. It was not enough for me, backed up my catalog folder and uploaded default template catalog folder. It didn't changed. Removed vqmod cache files.
So i started to think is there any problem for system folder files. Thinking for hours.

Why getting "granül" search word is going "gran%C3%BCl" for breadcrumb or pagination link exactly can't understand.

Code: Select all

http://www.akvaryumyemi.com/index.php?route=product/search&search=gran%C3%BCl&description=true&category_id=0&sub_category=true">
Did you cleared the OC cache after disabling / uninstalling the extension? viewtopic.php?f=134&t=215776#p718325

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Mon May 04, 2020 3:47 am

nickelaj wrote:
Mon May 04, 2020 2:54 am
Why getting "granül" search word is going "gran%C3%BCl" for breadcrumb or pagination link exactly can't understand.

Code: Select all

http://www.akvaryumyemi.com/index.php?route=product/search&search=gran%C3%BCl&description=true&category_id=0&sub_category=true">
That is the correct way to encode those characters in a URL. It's done on this line for the page links.
https://github.com/opencart/opencart/bl ... h.php#L369

PHP will automatically perform a urldecode on the GET variables. So $this->request->get['search'] will contain the correct decoded characters. Extended characters in searches work fine for me on a clean install of 3.0.3.2. So it's probably an extension, modification or your theme that is causing the issue.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ADD Creative » Mon May 04, 2020 4:08 am

Also looks like your page links are http and not https and your redirect from http to https could be the cause.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by nickelaj » Mon May 04, 2020 4:21 am

straightlight wrote:
Mon May 04, 2020 3:10 am
nickelaj wrote:
Mon May 04, 2020 2:54 am
ADD Creative wrote:
Mon May 04, 2020 2:32 am
That's not fully disabling the extension.
Disabled from extensions, removed from modifications. And for exact solution changed header search from default template.
Still same. It was not enough for me, backed up my catalog folder and uploaded default template catalog folder. It didn't changed. Removed vqmod cache files.
So i started to think is there any problem for system folder files. Thinking for hours.

Why getting "granül" search word is going "gran%C3%BCl" for breadcrumb or pagination link exactly can't understand.

Code: Select all

http://www.mysite.com/index.php?route=product/search&search=gran%C3%BCl&description=true&category_id=0&sub_category=true">
Did you cleared the OC cache after disabling / uninstalling the extension? viewtopic.php?f=134&t=215776#p718325
Yes i cleared both of them.
Last edited by nickelaj on Fri May 08, 2020 1:33 am, edited 1 time in total.

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by straightlight » Mon May 04, 2020 4:26 am

Please post your .htaccess, config.php and admin/config.php files without database information.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nickelaj » Mon May 04, 2020 4:31 am

ADD Creative wrote:
Mon May 04, 2020 4:08 am
Also looks like your page links are http and not https and your redirect from http to https could be the cause.
Checking it now. Thanks

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by nickelaj » Mon May 04, 2020 4:37 am

straightlight wrote:
Mon May 04, 2020 4:26 am
Please post your .htaccess, config.php and admin/config.php files without database information.
.htaccess

Code: Select all

Options +FollowSymlinks
Options -Indexes
<FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))">
 Require all denied
</FilesMatch>

RewriteEngine On

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
Last edited by nickelaj on Mon May 04, 2020 9:32 pm, edited 1 time in total.

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by letxobnav » Mon May 04, 2020 11:02 am

you are double encoding your search term.

ürün encodes to %C3%BCr%C3%BCn encodes to %25C3%25BCr%25C3%25BCn
%25C3%25BCr%25C3%25BCn decodes to %C3%BCr%C3%BCn
and that is where you are.

either find the double encode or also double decode.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by nickelaj » Mon May 04, 2020 3:52 pm

letxobnav wrote:
Mon May 04, 2020 11:02 am
you are double encoding your search term.

ürün encodes to %C3%BCr%C3%BCn encodes to %25C3%25BCr%25C3%25BCn
%25C3%25BCr%25C3%25BCn decodes to %C3%BCr%C3%BCn
and that is where you are.

either find the double encode or also double decode.
Understood i think. I will check search and pagination files again.

New member

Posts

Joined
Fri Mar 27, 2015 7:53 pm

Post by ADD Creative » Mon May 04, 2020 7:20 pm

The HTTP_SERVER and HTTP_CATALOG settings in both your config,php files are wrong. The URLs need to start with: https://

The double encoding is caused by you redirect from http to https.

https://www.akvaryumyemi.com/index.php? ... rue&page=2
Works fine.

http://www.akvaryumyemi.com/index.php?r ... rue&page=2
Gets redirected to https and double encoded.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: Google [Bot] and 40 guests