diff --git a/vendor/magento/module-catalog-inventory/Model/ResourceModel/StockStatusFilter.php b/vendor/magento/module-catalog-inventory/Model/ResourceModel/StockStatusFilter.php index 3922670f175e8..1c0d18f786f27 100644 --- a/vendor/magento/module-catalog-inventory/Model/ResourceModel/StockStatusFilter.php +++ b/vendor/magento/module-catalog-inventory/Model/ResourceModel/StockStatusFilter.php @@ -10,10 +10,8 @@ use Magento\CatalogInventory\Api\Data\StockStatusInterface; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\CatalogInventory\Model\Stock; -use Magento\CatalogInventory\Model\StockStatusApplierInterface; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Select; -use Magento\Framework\App\ObjectManager; /** * Generic in-stock status filter @@ -32,25 +30,16 @@ class StockStatusFilter implements StockStatusFilterInterface */ private $stockConfiguration; - /** - * @var StockStatusApplierInterface - */ - private $stockStatusApplier; - /** * @param ResourceConnection $resource * @param StockConfigurationInterface $stockConfiguration - * @param StockStatusApplierInterface|null $stockStatusApplier */ public function __construct( ResourceConnection $resource, - StockConfigurationInterface $stockConfiguration, - ?StockStatusApplierInterface $stockStatusApplier = null + StockConfigurationInterface $stockConfiguration ) { $this->resource = $resource; $this->stockConfiguration = $stockConfiguration; - $this->stockStatusApplier = $stockStatusApplier - ?? ObjectManager::getInstance()->get(StockStatusApplierInterface::class); } /** @@ -79,13 +68,7 @@ public function execute( implode(' AND ', $joinCondition), [] ); - - if ($this->stockStatusApplier->hasSearchResultApplier()) { - $select->columns(["{$stockStatusTableAlias}.stock_status AS is_salable"]); - } else { - $select->where("{$stockStatusTableAlias}.stock_status = ?", StockStatusInterface::STATUS_IN_STOCK); - } - + $select->where("{$stockStatusTableAlias}.stock_status = ?", StockStatusInterface::STATUS_IN_STOCK); return $select; } } diff --git a/vendor/magento/module-catalog-inventory/Model/StockStatusApplier.php b/vendor/magento/module-catalog-inventory/Model/StockStatusApplier.php index 77d85034f14dd..597b8ad9160db 100644 --- a/vendor/magento/module-catalog-inventory/Model/StockStatusApplier.php +++ b/vendor/magento/module-catalog-inventory/Model/StockStatusApplier.php @@ -9,6 +9,9 @@ /** * Search Result Applier getters and setters + * + * @deprecated - as the implementation has been reverted during the fix of ACP2E-748 + * @see \Magento\InventoryCatalog\Plugin\Catalog\Model\ResourceModel\Product\CollectionPlugin */ class StockStatusApplier implements StockStatusApplierInterface { @@ -23,6 +26,8 @@ class StockStatusApplier implements StockStatusApplierInterface * Set flag, if the request is originated from SearchResultApplier * * @param bool $status + * @deprecated + * @see \Magento\InventoryCatalog\Plugin\Catalog\Model\ResourceModel\Product\CollectionPlugin::beforeSetOrder */ public function setSearchResultApplier(bool $status): void { @@ -33,6 +38,8 @@ public function setSearchResultApplier(bool $status): void * Get flag, if the request is originated from SearchResultApplier * * @return bool + * @deprecated + * @see \Magento\InventoryCatalog\Plugin\Catalog\Model\ResourceModel\Product\CollectionPlugin::beforeSetOrder */ public function hasSearchResultApplier() : bool { diff --git a/vendor/magento/module-catalog-inventory/Model/StockStatusApplierInterface.php b/vendor/magento/module-catalog-inventory/Model/StockStatusApplierInterface.php index db5e6cff7425f..791ad9a079547 100644 --- a/vendor/magento/module-catalog-inventory/Model/StockStatusApplierInterface.php +++ b/vendor/magento/module-catalog-inventory/Model/StockStatusApplierInterface.php @@ -9,6 +9,9 @@ /** * Search Result Applier interface. + * + * @deprecated - as the implementation has been reverted during the fix of ACP2E-748 + * @see \Magento\InventoryCatalog\Plugin\Catalog\Model\ResourceModel\Product\CollectionPlugin */ interface StockStatusApplierInterface { @@ -17,6 +20,8 @@ interface StockStatusApplierInterface * Set flag, if the request is originated from SearchResultApplier * * @param bool $status + * @deprecated + * @see \Magento\InventoryCatalog\Plugin\Catalog\Model\ResourceModel\Product\CollectionPlugin::beforeSetOrder */ public function setSearchResultApplier(bool $status): void; @@ -24,6 +29,8 @@ public function setSearchResultApplier(bool $status): void; * Get flag, if the request is originated from SearchResultApplier * * @return bool + * @deprecated + * @see \Magento\InventoryCatalog\Plugin\Catalog\Model\ResourceModel\Product\CollectionPlugin::beforeSetOrder */ public function hasSearchResultApplier() : bool; }