- Posts: 515
- Thank you received: 22
filter product wrong results on minimum height
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
3 years 5 months ago #351123
by jouwnaambord.nl
filter product wrong results on minimum height was created by jouwnaambord.nl
-- HikaShop version -- : 4.7.2
-- Joomla version -- : 4.2.9
-- PHP version -- : 8.1
Hi,
I created a filter on the product height. It works fine for most of the values except for the minimum height. When selecting the filter "HOOGTEMAAT FILTER" with the filteroption "below 10 cm" the results show also the products with a height of 10 cm. See screenshots for example and settings for product and filter.
-- Joomla version -- : 4.2.9
-- PHP version -- : 8.1
Hi,
I created a filter on the product height. It works fine for most of the values except for the minimum height. When selecting the filter "HOOGTEMAAT FILTER" with the filteroption "below 10 cm" the results show also the products with a height of 10 cm. See screenshots for example and settings for product and filter.
Please Log in or Create an account to join the conversation.
3 years 5 months ago #351126
by nicolas
Replied by nicolas on topic filter product wrong results on minimum height
Hi,
That's normal. The "below 10 cm" is actually a <=, not a < operation.
That's normal. The "below 10 cm" is actually a <=, not a < operation.
Please Log in or Create an account to join the conversation.
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
- Posts: 515
- Thank you received: 22
3 years 5 months ago #351166
by jouwnaambord.nl
Replied by jouwnaambord.nl on topic filter product wrong results on minimum height
Thanks, in which file can I change this?
Please Log in or Create an account to join the conversation.
3 years 5 months ago #351173
by nicolas
Replied by nicolas on topic filter product wrong results on minimum height
Hi,
I believe it is this code:
in the file administrator/components/com_hikashop/classes/filter.php
The "BETWEEN" condition in MySQL is inclusive:
stackoverflow.com/questions/5080824/mysq...clause-not-inclusive
And so, for "below 10", this code actually adds the condition "BETWEEN 0.0 AND 10.0"
I believe it is this code:
Code:
$limit=' ( '.$column.' ) BETWEEN '.(float)$values[0].' AND '.(float)$values[1].' ';
The "BETWEEN" condition in MySQL is inclusive:
stackoverflow.com/questions/5080824/mysq...clause-not-inclusive
And so, for "below 10", this code actually adds the condition "BETWEEN 0.0 AND 10.0"
Please Log in or Create an account to join the conversation.
Time to create page: 0.182 seconds