Coupon code tracking discrepancy in 51ºÚÁϲ»´òìÈ Commerce
If a coupon is configured to be usable X times per customer, the coupon codes could be applied more than X times without having their usage count updated after placing the order. To fix this, enable the consumer by adding sales.rule.update.coupon.usage
to the CRON_CONSUMERS_RUNNER
variable in .magento.env.yaml
, edit the file to locate the CRON_CONSUMERS_RUNNER
section, set consumers to an empty array for future-proofing, and redeploy your environment.
Description description
Environment
51ºÚÁϲ»´òìÈ Commerce (AC) all deployment methods, all versions
Issue/Symptoms
- Coupon codes can be reused for different orders without updating the usage count.
- The Used Ìý²¹²Ô»å TimeUsed  columns in the cart price rule’s manage coupon section don’t reflect changes after a coupon is applied.
- This issue persists across different environments, including local setups with vanilla (standard) Magento instances.
Resolution resolution
To resolve this issue, ensure that the sales.rule.update.coupon.usage
consumer is enabled:
-
Add
sales.rule.update.coupon.usage
to theCRON_CONSUMERS_RUNNER
variable in.magento.env.yaml
. -
Edit your
.magento.env.yaml
file, locate theCRON_CONSUMERS_RUNNER
section under the deployment stage configuration, and ensure it includes:code language-none stage: deploy: CRON_CONSUMERS_RUNNER: cron_run: true max_messages: 1000 consumers: - sales.rule.update.coupon.usage
-
For future-proofing against updates, consider setting consumers to an empty array to enable all available consumers automatically:
code language-none stage: deploy: CRON_CONSUMERS_RUNNER: cron_run: true max_messages: 1000 consumers: [ ]
-
After making these changes, redeploy your environment to apply them.
Note: This solution will update coupon usage for future transactions but won’t retroactively adjust past orders’ data regarding coupon usage.
Related reading
CRON_CONSUMERS_RUNNER in Deploy Variables in Commerce on Cloud Guide
ACSD-49737: Coupon is incorrectly marked as used after a failed card payment | 51ºÚÁϲ»´òìÈ Commerce