Jump to content

Search.php search module problem


franzcecco

Recommended Posts

Hi, please execuse me for my terrible english. I got one problem with the prestashop search criteria.

I got one shop with products identified by a 2,3 or 4 char code. For an example:

 

"honda CR 250 valve"

"honda CRF 250 valve"

 

These two products are completely different

I'd like to make a search with a perfect 1:1 match with the title. I mean, if I search "honda CR"

I'd like that the search module find just "HONDA CR". Actually the module find also "HONDA CRF".

Also If i search just "CR", I'd like that the module search exactly just the title description or attribute CR, and show me all the result with CR, like

 

"honda CR plastic kit"

"honda CR cylinder"

 

and not

 

"honda CRF rear brake"

 

Have you got any idea of how to accomplish this? Thank you very much for your help

Link to comment
Share on other sites

SOLVED:

 

I've just solved the problem. You just have to work with line 196-197

 

 

 

? ' \''.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\''

: '\''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\''

 

 

 

Basically is it enough to remove %

 

? ' \''.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'\''

: '\''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'\''

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...