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

#   Number 0 in the search field

##

- **[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
-
-

9 years 3 months ago [\#275147](#275147) by [gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")  *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#275147 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")* was created by *[gioferrario@gmail.com](/forum/user/35746-gioferrario-gmail-com "View gioferrario@gmail.com's Profile")*

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.4
-- PHP version -- : 7.
-- Browser(s) name and version -- : crome

Hello
I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc.
It seems that number 0 does not recognize it as a numeric value
Regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 3 months ago [\#275154](#275154) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#275154 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Hi,

There is no issue with 0.
That's the number behavior.
The system returns all the products with what you enter in the field in their name regardless of whether there is something else.
So it's not only with 0. If you enter "10", you'll also get 10, 104, 1000, etc. And if you enter 104, you'll also get 1040, 1045, 2104, etc.
Now in the settings of your filter, you have the setting "Search processing" where you can configure how the search should be have.
If you set "exact", then if you enter 0 in the search field, the system will only return the product with the product name being exactly "0".

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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
-
-

9 years 3 months ago [\#275252](#275252) 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 *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#275252 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Hello
The problem is exactly what is already set to exact, I have tried other parameters but the result does not change  [ ![snip&#95;20170803072005.png](/forum/attachment/39526) ](/forum/attachment/39526 "...0803072005.png")

- [ ![snip&#95;20170803072005.png](/forum/attachment/39526) ](/forum/attachment/39526 "...0803072005.png") [ ](/forum/attachment/39526?download=1 "...0803072005.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 3 months ago [\#275292](#275292) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#275292 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Hi,

Thanks for the screenshot and the additional details.
Change the code:
if(!empty($terms)){
to:
if(!empty($terms) &#124;&#124; strlen($terms)){
in the file administrator/components/com_hikashop/classes/filter.php and that should fix the problem with 0 in exact mode.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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
-
-

9 years 3 months ago [\#275329](#275329) 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 *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#275329 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Hello
I made a paste copy of the string you sent me but nothing changed

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 3 months ago -  9 years 3 months ago [\#275634](#275634) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#275634 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Hi,

Also change the code: Code:

if(!empty($infoGet)&amp;&amp; !is_array($infoGet)){ $infoGet = array($infoGet); } if(isset($infoGet[0])){ $infoGet[0] = trim($infoGet[0]); } if(!isset($infoGet) &#124;&#124; empty($infoGet[0]))

to: Code:

if(!is_array($infoGet)){ $infoGet = array($infoGet); } if(isset($infoGet[0])){ $infoGet[0] = trim($infoGet[0]); } if(!isset($infoGet) &#124;&#124; (empty($infoGet[0]) &amp;&amp; !strlen($infoGet[0])))

in that same file. I've tested it myself and it now works fine on my local test website.

Last edit: 9 years 3 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: code clean

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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
-
-

9 years 3 months ago [\#275755](#275755) 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 *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#275755 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Thanks a lot, problem solved

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

- **[fengel](/forum/user/37465-fengel "View fengel's Profile")**
- [![fengel's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar37465.jpg)](/forum/user/37465-fengel "View fengel's Profile")
- [ Offline](/forum/user/37465-fengel)

Less More

- Posts: 27
- Thank you received: 4
-
-

9 years 2 months ago [\#277558](#277558) by [fengel](/forum/user/37465-fengel "View fengel's Profile")  Replied by *[fengel](/forum/user/37465-fengel "View fengel's Profile")* on topic *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#277558 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Hi Nicolas,

Just wanted to quickly tell you that the code you posted above does not check for empty arrays. It produced unexpected results, such as filling in "Array" in the search input field upon refresh.

I changed: Code:

if(!isset($infoGet) &#124;&#124; (empty($infoGet[0]) &amp;&amp; !strlen($infoGet[0])))

to: Code:

if(!isset($infoGet) &#124;&#124; count($infoGet) == 0 &#124;&#124; (empty($infoGet[0]) &amp;&amp; !strlen($infoGet[0])))

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 2 months ago [\#277560](#277560) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#277560 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Hi,

Thank you for your feedback. We'll test and add the patch on our end.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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
-
-

9 years 2 months ago [\#277607](#277607) 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 *[Number 0 in the search field](/forum/45-filters-search/891371-number-0-in-the-search-field#277607 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7. -- Browser(s) name and version -- : crome  Hello I have a problem with the search field for a filter, i load the images rated with the number 0 but when i put in the search number field 0 I will see all the images containing one 0. if i insert 104 works and only finds 104 but if i I put 0 i find all 0 but also 10, 104, 1000 etc. It seems that number 0 does not recognize it as a numeric value Regards")*

Thanks everything works well!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MTM3MS1udW1iZXItMC1pbi10aGUtc2VhcmNoLWZpZWxkP3RtcGw9bWFya2Rvd24=) 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.066 seconds

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