ACSD-63062: Incorrect cart discount calculations with multiple overlapping rules

The ACSD-63062 patch fixes the issue where incorrect cart discount calculations occur when multiple overlapping rules are applied. This patch is available when the Quality Patches Tool (QPT) 1.1.56 is installed. The patch ID is ACSD-63062. Please note that the issue 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.7-p2

Compatible with Adobe Commerce versions:

Adobe Commerce (all deployment methods) 2.4.7 - 2.4.7-p3

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

Incorrect cart discount calculations occur when multiple overlapping rules are applied.

Steps to reproduce:

  1. Install fresh instance with sample data.

  2. Create three simple products:

    • simple1: $1080
    • simple2: $260
    • simple3: $280
  3. Create four Cart Price Rules as follows:

    • Rule 1:

      • Priority: 100
      • Conditions tab: Use simple2 ($280) product if total qty equals or is greater than 3
      • Actions tab: SKU is simple2
      • Fixed Amount Discount: $80
    • Rule 2:

      • Priority: 200
      • Actions tab: SKU is simple2
      • Percentage of Product Price Discount: 20%
    • Rule 3:

      • Priority: 300
      • Conditions tab: Subtotal equals or is greater than $1000
      • Fixed Amount Discount for the whole cart: $100
    • Rule 4:

      • Priority: 400
      • Conditions tab: Use simple1 ($1080) product if total qty equals or is greater than 2
      • Actions tab: SKU is simple1
      • Fixed Amount Discount for the whole cart: $960
  4. Go to the storefront and add the following products with given quantity to the cart:

    • simple1 = 2
    • simple2 = 1
    • simple3 = 3
  5. Check the shopping cart.

Expected results:

The discount applied is $1352.

Actual results:

The discount applied is $1525.33.

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