[Skip to main content](#vessel-content)

#   Text filter only on the whole word

##

- **[gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")**
- [![gioferrario@gmail.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile") Topic Author
- [ Offline](/forum/user/35746-gioferrario-gmail-com)

Less More

- Posts: 55
- Thank you received: 0
-
-

11 years 9 months ago [\#189396](#189396) by [gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")  *[Text filter only on the whole word](/forum/45-filters-search/874742-text-filter-only-on-the-whole-word#189396 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : crome  Good morning, I'm configuring a filter textual hikashop bussines and I have to look for numbers in a custom field, my problem is that if the number in question has three digits is the right product, but if the number has only its digits is all products with three digits appear where those two. An example: my products have a characteristic number, as I have three products, one is called the 789 one is called 89 and the other is called 123, and all belong to the same category, if I put in the text field 789 no problem, appears only the 789 but if I try the 89 shows both the 89 and 789 that I want to appear only 89. Among the selection items that attach not found anything that responds to the event. Thank You")* was created by *[gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.35
-- Browser(s) name and version -- : crome

Good morning, I'm configuring a filter textual hikashop bussines and I have to look for numbers in a custom field, my problem is that if the number in question has three digits is the right product, but if the number has only its digits is all products with three digits appear where those two.
An example: my products have a characteristic number, as I have three products, one is called the 789 one is called 89 and the other is called 123, and all belong to the same category, if I put in the text field 789 no problem, appears only the 789 but if I try the 89 shows both the 89 and 789 that I want to appear only 89. Among the selection items that attach not found anything that responds to the event.
Thank You

- [ ![Capture.jpg](/forum/attachment/22116) ](/forum/attachment/22116 "Capture.jpg") [ ](/forum/attachment/22116?download=1 "Capture.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDc0Mi10ZXh0LWZpbHRlci1vbmx5LW9uLXRoZS13aG9sZS13b3JkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 9 months ago [\#189412](#189412) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Text filter only on the whole word](/forum/45-filters-search/874742-text-filter-only-on-the-whole-word#189412 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : crome  Good morning, I'm configuring a filter textual hikashop bussines and I have to look for numbers in a custom field, my problem is that if the number in question has three digits is the right product, but if the number has only its digits is all products with three digits appear where those two. An example: my products have a characteristic number, as I have three products, one is called the 789 one is called 89 and the other is called 123, and all belong to the same category, if I put in the text field 789 no problem, appears only the 789 but if I try the 89 shows both the 89 and 789 that I want to appear only 89. Among the selection items that attach not found anything that responds to the event. Thank You")*

Hi,

That's how the system is made.
If you want to change that, you need to edit the file administrator/components/com_hikashop/classes/filter.php and remove all the % characters in the code: Code:

if(@$searchProcessing != 'any'){ foreach($terms as $term){ if(empty($term)) continue; $array =array(); foreach($searchField as $column){ $array[]=' b.'.$column.' LIKE \'%'.hikashop_getEscaped($term, true).'%\' '; $fields[] = ' reference_field = \''.$column.'\' '; } $list[]='('.implode(' OR ', $array).')'; $translationList[] = 'value LIKE \'%'.hikashop_getEscaped($term, true).'%\''; } $filters[]='('.implode(' AND ', $list).')'; $translationFilters = '('.implode(' AND ', $translationList).')'; }else{ foreach($terms as $term){ if(empty($term)) continue; foreach($searchField as $column){ $list[]=' b.'.$column.' LIKE \'%'.hikashop_getEscaped($term, true).'%\' '; $fields[] = ' reference_field = \''.$column.'\' '; } $translationList[] = 'value LIKE \'%'.hikashop_getEscaped($term, true).'%\''; } $filters[]='('.implode(' OR ', $list).')'; $translationFilters = '('.implode(' OR ', $translationList).')'; }

Then, the filter will only match exact values.

The following user(s) said Thank You: [gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDc0Mi10ZXh0LWZpbHRlci1vbmx5LW9uLXRoZS13aG9sZS13b3JkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")**
- [![gioferrario@gmail.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile") Topic Author
- [ Offline](/forum/user/35746-gioferrario-gmail-com)

Less More

- Posts: 55
- Thank you received: 0
-
-

11 years 9 months ago [\#189540](#189540) by [gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")  Replied by *[gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")* on topic *[Text filter only on the whole word](/forum/45-filters-search/874742-text-filter-only-on-the-whole-word#189540 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : crome  Good morning, I'm configuring a filter textual hikashop bussines and I have to look for numbers in a custom field, my problem is that if the number in question has three digits is the right product, but if the number has only its digits is all products with three digits appear where those two. An example: my products have a characteristic number, as I have three products, one is called the 789 one is called 89 and the other is called 123, and all belong to the same category, if I put in the text field 789 no problem, appears only the 789 but if I try the 89 shows both the 89 and 789 that I want to appear only 89. Among the selection items that attach not found anything that responds to the event. Thank You")*

Wow perfect !! think that in future editions it was inserted as an option with choices from buttons?

Thank you very much

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDc0Mi10ZXh0LWZpbHRlci1vbmx5LW9uLXRoZS13aG9sZS13b3JkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 9 months ago [\#189557](#189557) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Text filter only on the whole word](/forum/45-filters-search/874742-text-filter-only-on-the-whole-word#189557 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : crome  Good morning, I'm configuring a filter textual hikashop bussines and I have to look for numbers in a custom field, my problem is that if the number in question has three digits is the right product, but if the number has only its digits is all products with three digits appear where those two. An example: my products have a characteristic number, as I have three products, one is called the 789 one is called 89 and the other is called 123, and all belong to the same category, if I put in the text field 789 no problem, appears only the 789 but if I try the 89 shows both the 89 and 789 that I want to appear only 89. Among the selection items that attach not found anything that responds to the event. Thank You")*

Hi,

Yes, we'll add an "exact" choice for the "search processing" option of the text filters in the next version in order to avoid the need for a code modification.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDc0Mi10ZXh0LWZpbHRlci1vbmx5LW9uLXRoZS13aG9sZS13b3JkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
