Skip to content

Commit eaf17db

Browse files
author
Stanislav Idolov
authored
ENGCOM-1303: 758: update Magento 2 core to support MSI #14675
2 parents 143202a + 0e7b8f8 commit eaf17db

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/code/Magento/CatalogSearch/Model/Search/FilterMapper/TermDropdownStrategy/ApplyStockConditionToSelect.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\App\ResourceConnection;
1111
use Magento\Framework\DB\Select;
12+
use Magento\CatalogInventory\Model\Stock\Status;
1213

1314
/**
1415
* Apply stock condition to select.
@@ -43,7 +44,12 @@ public function execute(
4344
) {
4445
$select->joinInner(
4546
[$stockAlias => $this->resourceConnection->getTableName('cataloginventory_stock_status')],
46-
sprintf('%2$s.product_id = %1$s.source_id', $alias, $stockAlias),
47+
sprintf(
48+
'%2$s.product_id = %1$s.source_id AND %2$s.stock_status = %3$d',
49+
$alias,
50+
$stockAlias,
51+
Status::STATUS_IN_STOCK
52+
),
4753
[]
4854
);
4955
}

0 commit comments

Comments
 (0)