Skip to content

Commit b289bae

Browse files
Fix typo which trigger performance bug
Fix bug when Category Products Count cannot be taken from catalog_category_product_index table
1 parent bbaa528 commit b289bae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function loadProductCount($items, $countRegular = true, $countAnchor = tr
327327
$countSelect = $this->getProductsCountQuery($categoryIds, (bool)$websiteId);
328328
$categoryProductsCount = $this->_conn->fetchPairs($countSelect);
329329
foreach ($anchor as $item) {
330-
$productsCount = isset($categoriesProductsCount[$item->getId()])
330+
$productsCount = isset($categoryProductsCount[$item->getId()])
331331
? (int)$categoryProductsCount[$item->getId()]
332332
: $this->getProductsCountFromCategoryTable($item, $websiteId);
333333
$item->setProductCount($productsCount);

0 commit comments

Comments
 (0)