Although it may sound weird, I'm currently using coupons as a method of payment. To achieve that, I generate 100% discount coupons attached to single products.

In my website, users can buy a product multiple times in different line items. This is because the order line item type has custom fields, so some line items cannot be merged into one single line.

However, I'm of course having issues with the rule "Apply percentage coupons to product line item", because the discount is applied for every line item, and I would like to get applied it to only one. Ideally, if the user submits two coupons of the same product, he could get discounted two line items.

Any ideas? Can a rule action loop have a break statement or something?

Many thanks

Comments

AndyF’s picture

Status: Active » Closed (won't fix)

I'm not sure if you can do that purely with Rules. Maybe you can use a variable to keep track of whether you've already applied a coupon or not, and use that as part of the condition for Apply coupon to line item (checking product reference). I wouldn't be surprised if you'd have to write your own custom action tho.

I wonder if there's not a neater way to achieve your overall aims?! Also it's worth mentioning that Coupon v2 and Commerce Discount are apparently the future, so you might want to see if they open up any new doors.

As a feature request I'm marking this won't fix because it's something of an edge case (seems to me) and this module ain't the future anyways!

HTH

Andy

Pere Orga’s picture

Thanks