I am trying to exclude some product variations that have specific product attributes from coupon discounts.
In my case I am targeting product variations that have a product attribute "finish" set to "Classic Frame" or "Box Frame" term.
I tried to use "Exclude variations with 2 specific attribute terms from coupon usage in Woocommerce" answer code and it does indeed make the coupon invalid when a product variation has a product attribute "finish" set to "Classic Frame" or "Box Frame" term.
But it also makes the coupon invalid for any other items added to the cart.
So for example if the cart has 3 items in it:
- Item 1: has the attribute "Classic Frame" ==> Coupon is Not Valid for this Item
- Item 2: has the attribute "Box Frame" ==> Coupon is Not Valid for this Item
- Item 3: has the attribute "Loose" ==> Coupon should be VALID for this Item
So what I would like is that the coupon discount is only applied to other items.
Any help is really appreciated.