Hi !
I've been trying to figure out how to deal with é and è letters in price tapestry.
Here is the problem: when someone types "cafetiere" or "cafetiére" (coffee machine in French) in the search engine, no results are found, because the product feeds contain "cafetière" but no "cafetiére" or "cafetiere" (a subtle difference which has a lot of impact on conversion).
Is there anyway to set a rule saying "é", "è", "e" are the same?
The goal being that, whenever someone types "cafetiere" OR "cafetière" OR "cafetiére", all the results containg EITHER "cafetiere" EITHER "cafetière" EITHER "cafetiére" show up.
Many thanks for your help,
Benoit
PS: I think a solution would actually be helpful in many languages (Spanish with n and ñ, Swedish with a and ä, etc...)
Hello David,
Thanks For Reply.
Here you give a solution for matching french letters. which will apply at the time of import feed.
So, i think when text have "é" will be replaced by "e". so now my title of product become change in DB.
Now if any one search with "cafetérian" then it will not give result.
so Question is the replacement of text in the import or on the search keyword.
Benoit
Hello Benoit,
Because the modification is made to the tapestry_normalise() function; the replacements should also apply to the search, because $q is passed through the same function at the top of search.php. If you find that search is not working for particular words after doing this, let me know an example and i'll check it out for you...
Cheers,
David.
Hello Benoit,
The solution here is to add some replacements to the tapestry_normalise() function in includes/tapestry.php. All product names etc. are processed by this function during import, as is the query when a user enters a search on your site.
For example, look for the following code:
$text = str_replace("-"," ",$text);
...and add the following to handle the examples in your post:
$text = str_replace("é","e",$text);
$text = str_replace("è","e",$text);
$text = str_replace("ä","a",$text);
$text = str_replace("ñ","n",$text);
You will have to import all feeds again so that they are processed by the new function.,.
Hope this helps!
Cheers,
David.