MDVA-39993: The inventory changes done through API are not reflected on the storefront product page
The inventory changes done through API are not reflected on the storefront product page. Quality patch MDVA-39993 for magento/module-inventory-catalog applies to Magento Open Source and Adobe Commerce 2.3.5 to 2.4.3-p3.
- Categories
- Inventory
- Components
- magento/module-inventory-catalog
- Origin
- adobe-commerce-support
- Since QPT
- 1.1.12
Issue
The inventory changes done through API are not reflected on the storefront product page.
Steps to reproduce
1. Make sure the queue is set to execute with cron and cron is installed and running. 1. Create a configurable product (COC001), with two colors (Black and Red), and two sizes (M and L). 1. Make one option out of stock (COC001-Red-M). 1. Load the configurable product page on the storefront and try clicking on each color. When you click Red, the size M should be crossed out because it is out of stock. 1. Make COC001-Red-M in stock using the following API endpoint and the payload: POST http://{domain}/rest/V1/inventory/source-items { "sourceItems": [ { "sku": "COC001-Red-M", "source_code": "default", "quantity": 1000, "status": 1 } ] } 1. Check this simple product from the backend and verify that it is updated to In Stock. 1. Load the configurable product from the frontend and click on each color. Notice the size M when you click on Red.
Adobe's page lists 2.3.5 - 2.3.7-p2, and 2.4.0 - 2.4.3-p1 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-39993. On Cloud, add MDVA-39993 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-39993/ 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-composer-metapackage >=1.1.5 <=1.1.7
- Replaced with
- MDVA-39993-V2
- Patch file
- patches/os/MDVA-39993_1.1.5.patch
- vendor/magento/module-inventory-catalog/Model/SourceItemsSaveSynchronization/SetDataToLegacyCatalogInventory.php
magento/inventory-metapackage >=1.2.0 <1.2.2
- Replaced with
- MDVA-39993-V2
- Patch file
- patches/os/MDVA-39993_1.2.0.patch
- vendor/magento/module-inventory-catalog/Model/SourceItemsSaveSynchronization/SetDataToLegacyCatalogInventory.php
magento/inventory-metapackage >=1.2.2 <1.2.4
- Requires
- MDVA-41061-V4, MDVA-40488
- Replaced with
- MDVA-39993-V2
- Patch file
- patches/os/MDVA-39993_1.2.2.patch
- vendor/magento/module-inventory-catalog/Model/SourceItemsSaveSynchronization/SetDataToLegacyCatalogInventory.php
