Jump to content

Multi language search


Recommended Posts

Hello,

 

I have a question about the search engine in Prestashop. My store is available in four languages and each language has his own product title. When I search a product I must use the name corresponding to the shop currently selected language or it would not find the product. This is a problem since many customers also would like to use english titles to find their products.

 

Is there a way to modify the search engine so that it search for products in any languages?

 

Thanks all for your help!

  • Like 1
Link to comment
Share on other sites

from what I can tell...it does not work. I have issue in 1609....not sure if I had the issue in 1462 but have seen this reported on the forum with no love.  Here are some things to look at, I am also interested in fix and my tech employee is on the beach in Greece so I'm going to throw in my hat to conversation.

 

here are some thinks worth looking at....

 

1.5(ish)

http://forge.prestashop.com/browse/PSCFV-8312

 

1.6(ish)

http://forge.prestashop.com/browse/PSCSX-5097

http://forge.prestashop.com/browse/PSCSX-5500

Link to comment
Share on other sites

Thanks for your answer El Patron, but I don't think it's a bug, I think it's the way it has been implemented, search only show results for your current language. Is there a way around this?

 

 

EDIT: I find out how to do it, you need to modify the Search.php file in modules and change this:

				$intersect_array[] = 'SELECT si.id_product
					FROM '._DB_PREFIX_.'search_word sw
					LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word
					WHERE sw.id_lang = '.(int)$id_lang.'
						AND sw.id_shop = '.$context->shop->id.'
						AND sw.word LIKE
					'.($word[0] == '-'
						? ' \''.$start_search.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\''
						: ' \''.$start_search.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\''
					);

To this:

				$intersect_array[] = 'SELECT si.id_product
					FROM '._DB_PREFIX_.'search_word sw
					LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word
					WHERE sw.id_shop = '.$context->shop->id.'
						AND sw.word LIKE
					'.($word[0] == '-'
						? ' \''.$start_search.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\''
						: ' \''.$start_search.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\''
					);
Edited by bcarron (see edit history)
  • Like 3
Link to comment
Share on other sites

×
×
  • Create New...