ACSD-62428: Stock status errors in catalog search index

The ACSD-62428 patch fixes the issue where is_out_of_stock values in the catalog search index is set to an incorrect value when the SKU attribute is not set as searchable. This patch is available with the Quality Patches Tool (QPT) 1.1.56. The patch ID is ACSD-62428. Please note that the issue was is scheduled to be fixed in Adobe Commerce 2.4.8.

Affected products and versions

The patch is created for Adobe Commerce version:

Adobe Commerce (all deployment methods) 2.4.6-p5

Compatible with Adobe Commerce versions:

Adobe Commerce (all deployment methods) 2.4.6 - 2.4.6-p8

NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

The is_out_of_stock value in the catalog search index is set to an incorrect value when the SKU is not configured as a searchable attribute, leading to inaccurate stock representation.

Steps to reproduce:

  1. Create a custom Source and custom Stock.
  2. Create three simple products and assign their inventory to the custom Source. Assign these products to a category.
  3. Set the Inventory (MSI) Indexer to Update on Save for easier replication.
  4. Set the Source Item Status to In Stock and assign a Quantity.
  5. Save the product.
  6. Navigate to Stores > Attributes > Product, and open the SKU attribute.
  7. Set Use In to No.
  8. Change the product quantity (make sure it is not set to 0).
  9. Save the product.

Expected results:

The is_out_of_stock value accurately reflects the product’s stock status, even when the SKU is not a searchable attribute.

Actual results:

The is_out_of_stock value is incorrectly set to 1, and the SKU attribute is absent in the indexed data.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3