MDVA-42584: Stock status of the configurable product in the backend is not updated automatically…
Stock status of the configurable product in the backend is not updated automatically when its simple product is set to In Stock through API or import. Quality patch MDVA-42584 for magento/module-inventory-configurable-product applies to Magento Open Source and Adobe Commerce 2.4.2 to 2.4.3-p3.
- Categories
- Catalog/Product
- Components
- magento/module-inventory-configurable-product, magento/module-configurable-import-export, magento/module-configurable-product
- Origin
- adobe-commerce-support
- Since QPT
- 1.1.10
Issue
Stock status of the configurable product in the backend is not updated automatically when its simple product is set to In Stock through API or import.
Steps to reproduce
1. Create a configurable product, InvCheck001, with two options: InvCheck001-M and InvCheck001-L. 1. Both the simple products should have Quantity and they should be In Stock so that the configurable product is also In Stock in the backend. 1. Now, update both simple products and set Quantity to 0 and Stock Status to Out of Stock. 1. Refresh the configurable product and verify the stock status is updated to Out of Stock. 1. Use the following API endpoint and set the simple product InvCheck001-M to In Stock with Quantity > 0. /rest/V1/inventory/source-items { "sourceItems": [ { "sku": "InvCheck001-M", "source_code": "default", "quantity": 10, "status": 1 } ] } 1. Go to the backend and verify the quantity and stock status of the simple product InvCheck001-M. It is updated to In stock. 1. Refresh the configurable product and check the stock status.
Adobe's page lists 2.4.2 - 2.4.2-p2 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.
Adobe scheduled the permanent fix for 2.4.5.
Install
Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply MDVA-42584. On Cloud, add MDVA-42584 under stage.build.QUALITY_PATCHES in .magento.env.yaml.
For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-42584/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.
Patch files and compatible versions
magento/inventory-metapackage >=1.2.2 <1.2.3
- Requires
- MDVA-40488
- Replaced with
- MDVA-41061-V4
- Patch file
- patches/os/MDVA-42584_1.2.2.patch
- vendor/magento/module-inventory-configurable-product/Plugin/InventoryApi/UpdateConfigurableProductParentStockStatus.php (added)
- vendor/magento/module-inventory-configurable-product/etc/di.xml
magento/inventory-metapackage >=1.2.3 <1.2.4
- Requires
- MDVA-40488
- Replaced with
- MDVA-41061-V4
- Patch file
- patches/os/MDVA-44500_1.2.3-p1.patch
- vendor/magento/module-inventory-configurable-product/Plugin/InventoryApi/UpdateConfigurableProductParentStockStatus.php (added)
- vendor/magento/module-inventory-configurable-product/etc/di.xml
magento/magento2-base >=2.4.2 <2.4.3
- Replaced with
- MDVA-41061-V4
- Patch file
- patches/os/MDVA-42584_2.4.2-p2.patch
- vendor/magento/module-configurable-import-export/Plugin/Import/Product/UpdateConfigurableProductsStockItemStatusPlugin.php (added)
- vendor/magento/module-configurable-import-export/etc/di.xml
- vendor/magento/module-configurable-product/Model/Inventory/ChangeParentStockStatus.php (added)
- vendor/magento/module-configurable-product/Model/Inventory/ParentItemProcessor.php
