From b675c25208c953150f1770024d19c47185d9dd9f Mon Sep 17 00:00:00 2001 From: Florian Thomi Date: Tue, 4 Aug 2026 17:30:24 +0200 Subject: [PATCH] fix: re-check price for every product whose indexed range exceeds the filter The SQL selects products with inclusive bounds (price_min <= max), while the straddle test used a strict comparison (price_min < max). A product whose indexed price_min lands exactly on the requested upper bound therefore escaped the re-check and stayed in the listing at its real price, outside the range. The mirror case exists on the lower bound. The extra clause is unnecessary: a re-check is needed exactly when the indexed envelope is not fully contained in the requested range, since a contained envelope guarantees the real price is in range. Also drop the int casts, which truncated non-integer bounds before comparison. --- src/Filters/Products.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Filters/Products.php b/src/Filters/Products.php index ab0083842..d9f1c3016 100644 --- a/src/Filters/Products.php +++ b/src/Filters/Products.php @@ -158,8 +158,8 @@ private function filterPrice( ) { /* for this case, price could be out of range, so we need to compute the real price */ foreach ($matchingProductList as $key => $product) { - if (($product['price_min'] < (int) $priceFilter['min'] && $product['price_max'] > (int) $priceFilter['min']) - || ($product['price_max'] > (int) $priceFilter['max'] && $product['price_min'] < (int) $priceFilter['max']) + if ($product['price_min'] < $priceFilter['min'] + || $product['price_max'] > $priceFilter['max'] ) { $price = Product::getPriceStatic($product['id_product'], $psLayeredFilterPriceUsetax); if ($psLayeredFilterPriceRounding) {