ACSD-61553: Cart Price Rule is incorrectly calculated when multiple discounts with different priorities are applied

The ACSD-61553 patch fixes the issue where the Cart Price Rule is incorrectly calculated when multiple discounts with different priorities are applied. This patch is available when the Quality Patches Tool (QPT) 1.1.53 is installed. The patch ID is ACSD-61553. Please note that this 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.5-p8

Compatible with Adobe Commerce versions:

Adobe Commerce (all deployment methods) 2.4.5 - 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

Cart Price Rule is incorrectly calculated when multiple discounts with different priorities are applied.

Steps to reproduce:

  1. Create a simple product with a price of $9,000.

  2. Create a Cart Price Rule: Rule A with a fixed discount of $700 without any conditions and without discarding subsequent rules.

  3. Create another Cart Price Rule: Rule B with a fixed discount of $1000 without any conditions and without discarding subsequent rules.

  4. Add the product with the quantity 13 to the cart.

  5. Update the rules with any of the below scenarios:

    Scenario 01

    code language-none
     Rule A
         Priority: 1
         Maximum Qty Discount is Applied To: 1
    
     Rule B
         Priority: 0
         Maximum Qty Discount is Applied To: 0
    

    Scenario 02

    code language-none
     Rule A
         Priority: 0
         Maximum Qty Discount is Applied To: 0
    
     Rule B
         Priority: 1
         Maximum Qty Discount is Applied To: 1
    

    Scenario 03

    code language-none
     Rule A
         Priority: 0
         Maximum Qty Discount is Applied To: 0
    
    Rule B
         Priority: 0
         Maximum Qty Discount is Applied To: 1
    
  6. Click the Update Shopping Cart button to recalculate the discounts.

Expected results:

You see the following total discount for different scenarios:

Scenario 01: $13,700
Scenario 02: $10,100
Scenario 03: $10,100

Actual results:

In all the three scenarios, the total discount is $9,000.

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:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

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