You can configure Commerce to remove unused coupon-based promotions from the user’s profile during processing. This feature tidies up promotions that customers have qualified for, but did not use on an order. The process is as follows:
Customer creates an order.
Customer enters a coupon code.
Promotion is added to the customer’s profile.
Customer does not qualify for the promotion when the order is placed.
If unused promotions are not removed, those promotions remain on the customer’s profile and can be used on a later order (if the customer qualifies) without re-entering the coupon code.
To enable unused coupon removal, set the removeUnusedCouponBasedPromotions
property of the RemoveUnusedPromotions
component to true
. The default is false. If set to true, the ProcRemoveUnusedPromotions
pipeline processor in the processOrder
pipeline chain looks at each promotion’s status and removes promotions that meet all of the following criteria:
Created as a result of a coupon claim
Single-use
Has not been used
Start date is before the current date
If the customer wants to enable this feature, the RemoveUnusedPromotions.enabled
property must be set to true
. The default is false
.