This article provides a patch for the known Adobe Commerce 2.2.2 issue related to the configurable product swatches being out of stock not displayed as crossed out on the storefront.
When you have a configurable product, and for a certain combination of options, the related simple product is out of stock, the swatch is still available and can be selected on the storefront.
- In the Commerce Admin, create a configurable product with options for two attributes: color (red, black) and size (S, M, L).
- Set Quantity as "1" for each corresponding simple product.
- On the storefront, add red, M product to cart and checkout.
- In the Admin, process the order so that the item quantity is updated to "0".
- Make sure backorders are not allowed.
- On the storefront, navigate to the same product page and select the same options: red, M.
The red, M swatch has a red slash and cannot be selected.
The red, M swatch can be selected.
The patch is attached to this article. To download it, scroll down to the end of the article and click the file name or click the following link:
Compatible Adobe Commerce versions:
The patch was created for:
- Adobe Commerce (all deployment methods) 2.2.2
The patch is also compatible (but might not solve the issue) with the following Adobe Commerce versions and editions:
- Adobe Commerce on-premises and Adobe Commerce on cloud infrastructure 2.2.0-2.2.3
How to apply the patch
See How to apply a composer patch provided by Adobe Commerce for instructions.