Question: “I am experiencing problems when I try to search “lædersnørre” on the Prestashop website, using special characters “æ” and “ø” . This word will be found only if I type “laedersnorre”. I was wondering if you have run into this special characters problem previously, maybe with some cyrillic letters?”
Answer: Replace your Search.php file with this Search.
A new file contains comments in Search -> indexation ()
1 2 3 |
$word = Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH); // Remove accents /* $word = Tools::replaceAccentedChars($word); */ |
Partner With Us
Looking for a partner to grow your business? We are the right company to bring your webstore to success.
Talk to Andrey
I have also the same problem with character +, removed line 58 urldecode() but no luck. Still cant search like A+A
please help!
Hi, I use the prestashop 1.6.7, I want calculate the special character (- , + , _) in the search, how i can do this?
@Mike PrestaShop uses urldecode() function for processing the search query string. https://github.com/PrestaShop/PrestaShop/blob/1.6.1.x/controllers/front/SearchController.php#L58
Among others this function replaces «+» with a space. This is done for using long phrases in queries. You can override the SearchControllerCore::initContent() method and remove urldecode() in your case.
HI, on PS 1616 I would get symbol “+” inlcuded on search. I have some products that are titled A+A Fashion … but when searching result is 0 (zero). Customers always search for A+A because it’s well known. Also with alias it cannot solve the problem, because symbol “+” (I mean plus) is always not considered. Tks in adavnce for your support
Alcino Major,
You need to delete symbols screening in the template. If you have any troubles you can contact our support team at [email protected]
Hi Alexander, I have a similar problem one PS 1.6 but the wrong characters accents affects only on the categories when you do hover mouse on a category meta description.
can you please help on this one?
Thanks
Denise,
your website is not avaliable at the moment.
Igor,
see how search function works here: http://blog.belvg.com/developer-tips-how-prestashop-search-works.html
Maybe you have to change sanitize() function.
Hi,
I have problem with “-” in my products name. For example:
I have product “fx-10”, but when I type “fx-10” in search, search found “fx-10”, but search show other product, because one product have description “This is for printer from FX serie: 1000, 1100, 1200…”, and search font “fx” and “10” from keyword “1000”.
EXAMPLE 2:
Search need to find keywords “LQ-1000” like whole keyword, but it separate to two keywords “LQ” and “1000”, because it is same problem like for “&”. And result is:
1. on list: – Product with name “INK for LQ-1000”
2. on list: Product with description “This is….. LQ seres 1000, 1200, 1500…”
/ this second search result is wrong, ti need to be only 1. result….
I think it is same problem like &, æ or /…. I konw how to remove “#$%&/ sign, but how to remove sign: “-“.
I need “-” in search.
I use prestashop 1.5.3.
Thank you!
Best regards,
Igor
hi i have this website in danish language
smykkekurven.dk/marianne/
i cant search my categories now. example are Øreringe it has a oslash special character.
i try your advice but its not working. i notice this word though that its working
Armbånd
the special a character work but not the oslash.
please help me. by the way right now i edit searchcontroller.php and add this on line 91
$query = Tools::replaceAccentedChars(urldecode($query));
and i remove the advise you had in search.php in classes folder.
please advice
RC,
In Search class, it’s necessary to change PREG_CLASS_SEARCH_EXCLUDE constant by deleting \x{0}-
Hi Alex,
Thanks you for your good tip!
But how would I go about searching for products with “&” in the name?
Lets say I have a candy-store. When I search for “M&M candy” every products gets listed, instead of just the “M&M candy” product.
Thanks in advance.