diff --git a/vendor/magento/module-inventory-configurable-product/Model/IsProductSalableCondition/IsConfigurableProductChildrenSalable.php b/vendor/magento/module-inventory-configurable-product/Model/IsProductSalableCondition/IsConfigurableProductChildrenSalable.php deleted file mode 100644 index 7118e57c0156..000000000000 --- a/vendor/magento/module-inventory-configurable-product/Model/IsProductSalableCondition/IsConfigurableProductChildrenSalable.php +++ /dev/null @@ -1,88 +0,0 @@ -configurable = $configurable; - $this->areProductsSalable = $areProductsSalable; - $this->getProductIdsBySkus = $getProductIdsBySkus; - $this->getSkusByProductIds = $getSkusByProductIds; - } - - /** - * Get configurable product salable status based on children products salable status - * - * Returns TRUE if: - * - * - at least one child is salable - * - * @param string $sku - * @param int $stockId - * @return bool - * @throws \Magento\Framework\Exception\NoSuchEntityException - */ - public function execute(string $sku, int $stockId): bool - { - $isSalable = false; - $productId = $this->getProductIdsBySkus->execute([$sku])[$sku]; - $ids = $this->configurable->getChildrenIds($productId); - $childrenSkus = $this->getSkusByProductIds->execute($ids[0]); - // check associated products salability one by one rather in batch for performance reason - foreach ($childrenSkus as $childSku) { - $results = $this->areProductsSalable->execute([$childSku], $stockId); - $result = reset($results); - if ($result && $result->isSalable()) { - $isSalable = true; - break; - } - } - - return $isSalable; - } -} diff --git a/vendor/magento/module-inventory-configurable-product/Plugin/InventorySales/Model/IsProductSalableCondition/GetIsQtySalableForConfigurableProduct.php b/vendor/magento/module-inventory-configurable-product/Plugin/InventorySales/Model/IsProductSalableCondition/GetIsQtySalableForConfigurableProduct.php deleted file mode 100644 index 090c855feef8..000000000000 --- a/vendor/magento/module-inventory-configurable-product/Plugin/InventorySales/Model/IsProductSalableCondition/GetIsQtySalableForConfigurableProduct.php +++ /dev/null @@ -1,60 +0,0 @@ -getProductTypesBySkus = $getProductTypesBySkus; - $this->isConfigurableProductChildrenSalable = $isConfigurableProductChildrenSalable; - } - - /** - * Check configurable product salable status based on selections salable status - * - * @param GetIsQtySalableInterface $getIsQtySalable - * @param bool $isSalable - * @param string $sku - * @param int $stockId - * @return bool - * @throws \Magento\Framework\Exception\NoSuchEntityException - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterExecute( - GetIsQtySalableInterface $getIsQtySalable, - bool $isSalable, - string $sku, - int $stockId - ): bool { - return $this->getProductTypesBySkus->execute([$sku])[$sku] === Configurable::TYPE_CODE - ? $this->isConfigurableProductChildrenSalable->execute($sku, $stockId) - : $isSalable; - } -} diff --git a/vendor/magento/module-inventory-configurable-product/etc/di.xml b/vendor/magento/module-inventory-configurable-product/etc/di.xml index 8f15e94bef3f..805dac49c3b6 100644 --- a/vendor/magento/module-inventory-configurable-product/etc/di.xml +++ b/vendor/magento/module-inventory-configurable-product/etc/di.xml @@ -46,10 +46,6 @@ - - -