diff --git a/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php b/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php index 4ad15ea905f0..019e2d648a27 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php +++ b/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php @@ -76,7 +76,7 @@ public function execute(array $childrenIds): void * @param int $productId * @return void */ - private function processStockForParent(int $productId): void + public function processStockForParent(int $productId): void { $criteria = $this->criteriaInterfaceFactory->create(); $criteria->setScopeFilter($this->stockConfiguration->getDefaultScopeId()); diff --git a/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php b/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php index 4ae3efdd6aca..d8426ae456fe 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php +++ b/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php @@ -53,5 +53,9 @@ public function __construct( public function process(Product $product) { $this->changeParentStockStatus->execute([$product->getId()]); + + if ($product->getTypeId() === Configurable::TYPE_CODE) { + $this->changeParentStockStatus->processStockForParent((int) $product->getId()); + } } }