filter product wrong results on minimum height

  • Posts: 506
  • Thank you received: 21
  • Hikashop Business
1 year 6 days ago #351123

-- 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.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
1 year 6 days ago #351126

Hi,

That's normal. The "below 10 cm" is actually a <=, not a < operation.

Please Log in or Create an account to join the conversation.

  • Posts: 506
  • Thank you received: 21
  • Hikashop Business
1 year 5 days ago #351166

Thanks, in which file can I change this?

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
1 year 5 days ago #351173

Hi,

I believe it is this code:

$limit=' ( '.$column.' ) BETWEEN '.(float)$values[0].' AND '.(float)$values[1].' ';
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"

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum