Skip to content

Commit 3af00b3

Browse files
committed
Merge remote-tracking branch 'tango/MAGETWO-97235' into TANGO-PR-2019-2.3
2 parents 99bec48 + e1cfd2c commit 3af00b3

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
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

app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/AttributeTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,6 @@ public function testGetItemsWithoutApply()
321321
->method('build')
322322
->will($this->returnValue($builtData));
323323

324-
$this->fulltextCollection->expects($this->once())
325-
->method('getSize')
326-
->will($this->returnValue(50));
327-
328324
$expectedFilterItems = [
329325
$this->createFilterItem(0, $builtData[0]['label'], $builtData[0]['value'], $builtData[0]['count']),
330326
$this->createFilterItem(1, $builtData[1]['label'], $builtData[1]['value'], $builtData[1]['count']),
@@ -383,9 +379,6 @@ public function testGetItemsOnlyWithResults()
383379
$this->fulltextCollection->expects($this->once())
384380
->method('getFacetedData')
385381
->willReturn($facetedData);
386-
$this->fulltextCollection->expects($this->once())
387-
->method('getSize')
388-
->will($this->returnValue(50));
389382

390383
$this->itemDataBuilder->expects($this->once())
391384
->method('addItemData')

0 commit comments

Comments
 (0)