diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php index 3a47f78f935..83acc130dd0 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php @@ -142,10 +142,10 @@ public function getProductsStock($stock, $productIds, $lockRows = false) // so using a separate query here significantly reduces the number of // unnecessarily locked rows in other tables, thereby avoiding deadlocks. $select = $this->_getWriteAdapter()->select() - ->from($productTable, ['entity_id', 'type_id']) + ->from($productTable, array('entity_id', 'type_id')) ->where('entity_id IN(?)', $productIds); $typeIds = $this->_getWriteAdapter()->fetchPairs($select); - foreach ($rows as $row) { + foreach ($rows as &$row) { $row['type_id'] = $typeIds[$row['product_id']]; } return $rows;