QUALITY PATCH

MDVA-40488: Configurable products with out-of-stock child products are not shown in their correct…

Configurable products with out-of-stock child products are not shown in their correct price range. Quality patch MDVA-40488 for magento/module-configurable-product applies to Magento Open Source and Adobe Commerce 2.4.2 to 2.4.3-p3.

Categories
Catalog/Product
Components
magento/module-configurable-product, magento/module-inventory-configurable-product
Origin
adobe-commerce-support
Since QPT
1.1.9

Issue

Configurable products with out-of-stock child products are not shown in their correct price range.

Steps to reproduce

1. Create a configurable product with two associated products. For example: simple products Red and Brown. 1. Set inventory of the simple product Red, and set Stock Status to In Stock, then set the Enable Product status to No. 1. Set inventory of the simple product Brown, then set the Enable Product status to Yes. 1. Make sure the configurable product Stock Status is In Stock. 1. Change the inventory of the simple product Brown to 0 and set the Stock Status to Out of Stock. 1. At this point, the configurable product Stock Status is still In Stock. 1. Perform reindex. 1. Check the min_price and max_price for the configurable product in the catalog_product_index_price DB table - the two values are set to 0. 1. But if we set the configurable product Stock Status to Out of stock and do reindex, then we can see non-zero min_price and max_price values of the configurable product.

Adobe's page lists 2.4.2 - 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.4.

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-40488. On Cloud, add MDVA-40488 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-40488/ 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

Packages across compatible versions (2): magento/module-configurable-product, magento/module-inventory-configurable-product
Packages across compatible versions (2): magento/module-configurable-product, magento/module-inventory-configurable-product

magento/magento2-base >=2.4.2 <2.4.4

Magento Open Source
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2
Adobe Commerce
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2
Patch file
patches/os/MDVA-40488_2.4.2-p1.patch
  • vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/BaseStockStatusSelectProcessor.php
  • vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/Configurable.php
  • vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/OptionsIndexer.php (added)
  • vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/OptionsIndexerInterface.php (added)
  • vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/OptionsSelectBuilder.php (added)
  • vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/OptionsSelectBuilderInterface.php (added)
  • vendor/magento/module-configurable-product/etc/di.xml

magento/inventory-metapackage >=1.2.2 <1.2.3

Magento Open Source
2.4.2-p2, 2.4.2-p1, 2.4.2
Adobe Commerce
2.4.2-p2, 2.4.2-p1, 2.4.2
Requires
MDVA-41061-V4
Patch file
patches/os/MDVA-40488_1.2.2.patch
  • vendor/magento/module-inventory-configurable-product/Pricing/Price/Indexer/BaseStockStatusSelectProcessor.php
  • vendor/magento/module-inventory-configurable-product/Pricing/Price/Indexer/OptionsIndexer.php (added)
  • vendor/magento/module-inventory-configurable-product/etc/di.xml

magento/inventory-metapackage >=1.2.3 <1.2.4

Magento Open Source
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3
Adobe Commerce
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3
Requires
MDVA-41061-V4
Patch file
patches/os/MDVA-40488_1.2.3.patch
  • vendor/magento/module-inventory-configurable-product/Pricing/Price/Indexer/BaseStockStatusSelectProcessor.php
  • vendor/magento/module-inventory-configurable-product/Pricing/Price/Indexer/OptionsIndexer.php (added)
  • vendor/magento/module-inventory-configurable-product/etc/di.xml

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.