From ff7d38070e2a5b14998472d9d7c1b77e58f60e0a Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Thu, 19 Oct 2023 14:54:28 -0400 Subject: [PATCH] fix(inventory-catalog): don't join disabled products into collection --- .../Model/ResourceModel/AddStockDataToCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InventoryCatalog/Model/ResourceModel/AddStockDataToCollection.php b/InventoryCatalog/Model/ResourceModel/AddStockDataToCollection.php index 5ec2d12a2e6..20c73286d3c 100644 --- a/InventoryCatalog/Model/ResourceModel/AddStockDataToCollection.php +++ b/InventoryCatalog/Model/ResourceModel/AddStockDataToCollection.php @@ -55,7 +55,7 @@ public function execute(Collection $collection, bool $isFilterInStock, int $stoc $isSalableColumnName = 'stock_status'; $resource = $collection->getResource(); $collection->getSelect() - ->{$isFilterInStock ? 'join' : 'joinLeft'}( + ->join( ['stock_status_index' => $resource->getTable('cataloginventory_stock_status')], sprintf('%s.entity_id = stock_status_index.product_id', Collection::MAIN_TABLE_ALIAS), [IndexStructure::IS_SALABLE => $isSalableColumnName]