diff --git a/Model/Layer/Filter/Rating.php b/Model/Layer/Filter/Rating.php index 660e662..40a5385 100644 --- a/Model/Layer/Filter/Rating.php +++ b/Model/Layer/Filter/Rating.php @@ -120,14 +120,18 @@ protected function _getItemsData() } } krsort($optionsFacetedData); - - foreach ($optionsFacetedData as $value => $data) { - $sumCount += (int) $data['count']; - $items[$value] = [ - 'label' => $value, - 'value' => $value, - 'count' => $sumCount, - ]; + + $minCount = !empty($optionsFacetedData) ? min(array_column($optionsFacetedData, 'count')) : 0; + + if (!empty($this->currentFilterValue) || $minCount < $productCollection->getSize()) { + foreach ($optionsFacetedData as $value => $data) { + $sumCount += (int) $data['count']; + $items[$value] = [ + 'label' => $value, + 'value' => $value, + 'count' => $sumCount, + ]; + } } return $items;