Skip to content

Commit e2d5454

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-66515: [Performance] Reduce queries to stock_status_index on Category Page
1 parent 4cf3c38 commit e2d5454

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,7 @@ public function getSalableUsedProducts(\Magento\Catalog\Model\Product $product,
12751275
private function loadUsedProducts(\Magento\Catalog\Model\Product $product, $cacheKey, $salableOnly = false)
12761276
{
12771277
$dataFieldName = $salableOnly ? $this->usedSalableProducts : $this->_usedProducts;
1278-
$hasData = $product->hasData($dataFieldName);
1279-
if (!$hasData) {
1278+
if (!$product->hasData($dataFieldName)) {
12801279
$usedProducts = $this->readUsedProductsCacheData($cacheKey);
12811280
if ($usedProducts === null) {
12821281
$collection = $this->getConfiguredUsedProductCollection($product);
@@ -1288,9 +1287,8 @@ private function loadUsedProducts(\Magento\Catalog\Model\Product $product, $cach
12881287
}
12891288
$product->setData($dataFieldName, $usedProducts);
12901289
}
1291-
$child = $product->getData($dataFieldName);
12921290

1293-
return $child;
1291+
return $product->getData($dataFieldName);
12941292
}
12951293

12961294
/**

0 commit comments

Comments
 (0)