QUALITY PATCH

ACSD-59865: The Cart Price Rule fails to cancel previously applied rules due to an insufficient…

The Cart Price Rule fails to cancel previously applied rules due to an insufficient product quantity in the cart. Quality patch ACSD-59865 for magento/module-sales-rule applies to Magento Open Source and Adobe Commerce 2.4.4 to 2.4.6-p15.

Categories
Shopping Cart
Components
magento/module-sales-rule
Origin
adobe-commerce-support
Since QPT
1.1.52

Issue

The Cart Price Rule fails to cancel previously applied rules due to an insufficient product quantity in the cart.

Steps to reproduce

1. Log in as an admin. 1. Go to Marketing > Cart Price Rules and click on Add New rule. * Set Rule Name = Test - 1 * Select all Websites and Customer groups * Set Priority = 0 * Go to the Actions section: * Set Apply = Percent of product price discount * Set Discount amount = 10 * Set Maximum Qty Discount is Applied To = 100 * Set Discount Qty Step (Buy X) = 0 * Set Discard subsequent rules to No 1. Clear the cache. 1. Go to the Storefront, add one item to the cart, and proceed to checkout/cart. 1. Verify that the 10% discount is applied to your cart. 1. Return to the Cart Price Rules and create a new rule. * Set Rule Name = Test - 2 * Select all Websites and Customer Groups * Set Priority = 2 * Navigate to the Actions section: * Set Apply = Percent of product price discount * Set Discount amount = 20 * Set Maximum Qty Discount is Applied To = 100 * Set Discount Qty Step (Buy X) = 3 1. Clear the cache. 1. Go back to the Storefront again. 1. Update the cart to refresh the rules. Verify that the 10% discount is no longer applied. 1. Add items to your cart until the quantity meets the Step value required for the second rule.

Adobe's page lists 2.4.4 - 2.4.6-p7 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.4.8.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-59865. On Cloud, add ACSD-59865 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-59865/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/module-sales-rule
Packages across compatible versions (1): magento/module-sales-rule

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.