Skip to content

Commit a602762

Browse files
authored
Update Stock.php
Relates to issue: #8566 A flag set to null will always overwrite the isShowOutOfStock variable. So you can't set the default value from the admin configuration.
1 parent 84d382b commit a602762

File tree

1 file changed

+1
-1
lines changed
  • app/code/Magento/CatalogInventory/Helper

1 file changed

+1
-1
lines changed

app/code/Magento/CatalogInventory/Helper/Stock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function addIsInStockFilterToCollection($collection)
156156
$resource = $this->getStockStatusResource();
157157
$resource->addStockDataToCollection(
158158
$collection,
159-
!$isShowOutOfStock && $collection->getFlag('require_stock_items')
159+
!$isShowOutOfStock || $collection->getFlag('require_stock_items')
160160
);
161161
$collection->setFlag($stockFlag, true);
162162
}

0 commit comments

Comments
 (0)