From 90074ce6d136225bb4710791bc142ba9d8c1dc63 Mon Sep 17 00:00:00 2001 From: mborkowski Date: Wed, 21 Feb 2018 16:12:02 +0100 Subject: [PATCH] Fix results qty accuracy for slider-based filters Range-slider has a bug with expected results counter. This leads to displaying wrong quantity of expected results. For example when I have filtered an attribute to values between 70 and 80 (my_attribute=70-80) this method will return 70-79.9999... instead of 70-80. This contribution will will fix accuracy. --- .../view/frontend/web/js/range-slider-widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module-elasticsuite-catalog/view/frontend/web/js/range-slider-widget.js b/src/module-elasticsuite-catalog/view/frontend/web/js/range-slider-widget.js index ecc445d31..7c1ddb2d0 100644 --- a/src/module-elasticsuite-catalog/view/frontend/web/js/range-slider-widget.js +++ b/src/module-elasticsuite-catalog/view/frontend/web/js/range-slider-widget.js @@ -109,7 +109,7 @@ define(["jquery", 'Magento_Catalog/js/price-utils', 'mage/template', "jquery/ui" _getItemCount : function() { var from = this.from, to = this.to, intervals = this.intervals; - var count = intervals.map(function(item) {return item.value >= from && item.value < to ? item.count : 0;}) + var count = intervals.map(function(item) {return item.value >= from && item.value <= to ? item.count : 0;}) .reduce(function(a,b) {return a + b;}); return count; },