1

I am using commerce coupon percentage beta module.

My customer need to give coupon only for selected product types only.

Say for Cloths,Accessories but not for Shoes

How can I implement this? Can I write a rule and how?

Thanks

user1353519
  • 71
  • 2
  • 12

1 Answers1

0

You'll need to create a rule that reacts on the validate a coupon event. Since a coupon is applied to an order rather than an individual line item (when you add a product to the cart it isn't really a product anymore rather it is a line item) on an order, what you'll need to do is loop through each line item on the order and load the product via the product reference field on the line item. After loading the product you can check the product type and then set the coupon as invalid as needed.

Hope that helps :)

Brandon Beeler
  • 150
  • 1
  • 1
  • 7