Does anyone know how to use the Commerce Coupon module?
I created a coupon discount (%) type with Product_reference field; then, I created one coupon of that type, and selected the products to wich it should apply. This seems not to work.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
The key to creating the coupon rules are two events: "Validate Coupon," and "Redeem a Coupon."
In this case, you need to create a rule with the "Redeem a coupon" event; in it, you need to add the actions "Create coupon line item," and "Set granted coupon amount" (in that order). The "Set granted coupon amount" action requires a number that is the discount to be applied. You need to calculate this in the rule by finding the percentage of the order total.
This video may help.
For anyone coming across this question, please make sure you are using Commerce Coupon 2.x. Much of the functionality has changed and the process of creating coupons is much more simplified by being more tightly integrated with Discounts.
Essentially, 2.x leaves the discount logic and actions in the hands of the Discount module and focuses solely on tying those discounts to coupons and providing the necessary UI and functionality around that.
Note: as of current writing, a discount without a coupon will always apply to any order which meets the conditions whereas a discount with a coupon will only apply if the coupon is attached to the order. A discount with only disabled coupons will function as if it has no coupons attached to it. There are bugs floating around that discuss changing this.