ACP2E-5071: Stock unavailability message isn’t always displayed on product page when shopper’s cart contains full available quantity

The ACP2E-5071 patch fixes the issue where the stock unavailability message is not always displayed on the product page when the shopper’s cart already contains the full available quantity. This patch is available when the Quality Patches Tool (QPT) 1.1.86 is installed. The patch ID is ACP2E-5071. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.10.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.8

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.7 - 2.4.9
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 stock unavailability message is not always displayed on the product page when the shopper’s cart already contains the full available quantity.

Prerequisites:

Full page cache enabled (built-in, Varnish, or Fastly).

Steps to reproduce:

  1. In the Admin panel, go to Catalog > Products and create a simple product (Add Product > Simple Product) or open an existing one.
  2. Set Quantity to 2 and Stock Status to In Stock, and click Save. If there are several inventory sources, set Qty to 2 for the assigned source in the Sources section instead.
  3. As a guest in a private browser window, open the product page on the Storefront and reload it once so that it is served from the full page cache.
  4. Set Qty to 2 and click Add to Cart.
  5. To make the issue easier to reproduce, open the browser developer tools and, in the Performance panel, set CPU throttling to 6x slowdown.
  6. Set Qty to 1 and click Add to Cart. The page reloads and shows a stock error message, for example: Not enough items for sale.
  7. Click Add to Cart again many times, up to a few dozen, and let the page reload after each click.

Expected results:

  1. Every failed Add to Cart attempt shows the stock error message.

Actual results:

  1. After some attempts, the page reloads without showing the error message.

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
commerce-operations-help-tools