Skip to content

Commit 1af3db5

Browse files
committed
MAGETWO-96236: [SO-3036] Bug with stock status in price indexer
1 parent 910a976 commit 1af3db5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
9696

9797
$select->from(
9898
['stock_item' => $this->stockItem->getMainTable()],
99-
['*', 'MAX(stock_item.is_in_stock) as max_is_in_stock']
99+
['stock_item.product_id', 'MAX(stock_item.is_in_stock) as max_is_in_stock']
100100
);
101101

102102
if ($this->stockConfiguration->getManageStock()) {
103-
$select->where('stock_item.use_config_manage_stock = 1 OR stock_item.manage_stock = 1 ');
103+
$select->where('stock_item.use_config_manage_stock = 1 OR stock_item.manage_stock = 1');
104104
} else {
105-
$select->where('use_config_manage_stock = 0 AND manage_stock = 1 ');
105+
$select->where('stock_item.use_config_manage_stock = 0 AND stock_item.manage_stock = 1');
106106
}
107107

108108
$select->group('stock_item.product_id');

0 commit comments

Comments
 (0)