ACSD-69261: Single‑use cart price rule coupon reused due to incorrect times_used handling in partial invoice and cancellation flows
The ACSD-69261 patch fixes the issue where a cart price rule coupon configured for single use per customer was reused multiple times due to incorrect handling of the times_used attribute in partial invoice and remaining quantity cancellation scenarios. This patch is available when the Quality Patches Tool (QPT) 1.1.76 is installed. The patch ID is ACSD-69261. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.9.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.6-p13
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.4 - 2.4.8-p3
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
A cart price rule coupon configured for single-use per customer can be incorrectly reused multiple times, due to improper handling of the times_used attribute during partial invoice creation and cancellation of the remaining uninvoiced quantity.
Steps to reproduce:
-
Create a cart price rule with a coupon limited to one use per customer.
-
Place an order containing two items.
-
Increase the quantity of one item to two or more units, and apply the coupon.
-
Confirm that the following database tables have entries:
- The order stores the coupon correctly in the
sales_ordertable. - The
salesrule_coupon_usagetable showstimes_used= 1. - The
salesrule_customertable showstimes_used= 1.
- The order stores the coupon correctly in the
-
Create a partial invoice by invoicing only one unit of the item.
-
Cancel the remaining uninvoiced quantity.
-
Check the
times_usedfield values in thesalesrule_coupon_usageandsalesrule_customertables.
Expected results:
The system decrements the times_used value only after cancelling uninvoiced quantities following a partial invoice, allowing the coupon to be used again when it is configured for a single‑use per customer.
Actual results:
After cancellation, the times_used values are reset to zero instead of retaining their correct usage count.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide