Coupon for single use is used multiple times, Adobe Commerce
This article provides a solution for the issue when cart price rule coupons are not working properly. Merchants set up a coupon for single use and customers are able to use it multiple times.
Affected products and versions
Adobe Commerce (all deployment methods) 2.4.3 and above
Issue
Merchants set up a coupon for single use and customers are able to use it multiple times.
Steps to reproduce:
- Create a coupon and configure the coupon to single use.
- Proceed to checkout.
- Use the coupon that you just created.
- Proceed to checkout again and use the same coupon.
Expected result:
The coupon can only be used once. A message displays: The coupon code “COUPON_NAME” is not valid.
Actual result:
The coupon can be used more than once.
Cause
Merchants do not have sales.rule.update.coupon.usage
consumer set up and running that results in improper behavior.
Solution
Add the sales.rule.update.coupon.usage
consumer to the app/etc/env.php
file.
...
'cron_consumers_runner' =>
array [
'cron_run' => true,
'max_messages' => 20000,
'consumers' =>
array [
'sales.rule.update.coupon.usage'
]
],
...
For detailed steps, refer to Manage message queues > Configuration in our developer documentation.
Related reading
Message Queues Overview in our developer documentation.