- Posts: 37
- Thank you received: 2
Search for only last 4 characters of product name?
14 years 11 months ago #29701
by zoomyman
Search for only last 4 characters of product name? was created by zoomyman
Hello everyone,
I am thinking about how to implement the last 4 characters search feature.
Let's say all my products have got 11 characters in a name (numbers). I need the Hikashop plugin to show me the results based on only last 4 characters.
Ex: I have a product like this: 18910678910, so if i am searching for 8910, I only want to see the resalt based on the last 4 characters even if there is another part which contains same characters within the name.
Any advice would be highly appreciated.
ZoomyMan
I am thinking about how to implement the last 4 characters search feature.
Let's say all my products have got 11 characters in a name (numbers). I need the Hikashop plugin to show me the results based on only last 4 characters.
Ex: I have a product like this: 18910678910, so if i am searching for 8910, I only want to see the resalt based on the last 4 characters even if there is another part which contains same characters within the name.
Any advice would be highly appreciated.
ZoomyMan
Please Log in or Create an account to join the conversation.
14 years 11 months ago #29720
by nicolas
Replied by nicolas on topic Re: Search for only last 4 characters of product name?
Hi,
You need to edit the search plugin file plugins/search/hikashop_product.php and change
$word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
to:
$word = $db->Quote( '%'.$db->getEscaped( $word, true ), false );
and:
$text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
to:
$text = $db->Quote( '%'.$db->getEscaped( $text, true ), false );
You need to edit the search plugin file plugins/search/hikashop_product.php and change
$word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
to:
$word = $db->Quote( '%'.$db->getEscaped( $word, true ), false );
and:
$text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
to:
$text = $db->Quote( '%'.$db->getEscaped( $text, true ), false );
Please Log in or Create an account to join the conversation.
14 years 11 months ago #29909
by zoomyman
Replied by zoomyman on topic Re: Search for only last 4 characters of product name?
Thank you Nicolas, works great.
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds