What’s Wrong with Special Characters in Prestashop Search?

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 ()



12 comments

  1. 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.

  2. RC,

    In Search class, it’s necessary to change PREG_CLASS_SEARCH_EXCLUDE constant by deleting \x{0}-

  3. 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

  4. 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

  5. Alcino Major,

    You need to delete symbols screening in the template. If you have any troubles you can contact our support team at store@belvg.com

  6. 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

  7. Hi, I use the prestashop 1.6.7, I want calculate the special character (- , + , _) in the search, how i can do this?

  8. I have also the same problem with character +, removed line 58 urldecode() but no luck. Still cant search like A+A

    please help!

Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *