Skip to content

Commit 573f747

Browse files
committed
MAGETWO-97235: Not all sizes are available in the layered navigation (on Sample Data) with ElasticSearch
1 parent 9cb874f commit 573f747

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,10 @@ protected function _getItemsData()
9191
return $this->itemDataBuilder->build();
9292
}
9393

94-
$productSize = $productCollection->getSize();
95-
9694
$options = $attribute->getFrontend()
9795
->getSelectOptions();
9896
foreach ($options as $option) {
99-
$this->buildOptionData($option, $isAttributeFilterable, $optionsFacetedData, $productSize);
97+
$this->buildOptionData($option, $isAttributeFilterable, $optionsFacetedData);
10098
}
10199

102100
return $this->itemDataBuilder->build();
@@ -108,17 +106,16 @@ protected function _getItemsData()
108106
* @param array $option
109107
* @param boolean $isAttributeFilterable
110108
* @param array $optionsFacetedData
111-
* @param int $productSize
112109
* @return void
113110
*/
114-
private function buildOptionData($option, $isAttributeFilterable, $optionsFacetedData, $productSize)
111+
private function buildOptionData($option, $isAttributeFilterable, $optionsFacetedData)
115112
{
116113
$value = $this->getOptionValue($option);
117114
if ($value === false) {
118115
return;
119116
}
120117
$count = $this->getOptionCount($value, $optionsFacetedData);
121-
if ($isAttributeFilterable && (!$this->isOptionReducesResults($count, $productSize) || $count === 0)) {
118+
if ($isAttributeFilterable && $count === 0) {
122119
return;
123120
}
124121

0 commit comments

Comments
 (0)