title: Applying a WooCommerce coupon conditionally based on product attribute terms
body: <p>I am trying to exclude some product variations that have specific product attributes from coupon discounts.</p>
  
  <p>In my case I am targeting product variations that have a product attribute "finish" set to "Classic Frame" or "Box Frame" term.</p>
  
  <p>I tried to use <em>"<a href="https://stackoverflow.com/questions/54297527/exclude-variations-with-2-specific-attribute-terms-from-coupon-usage-in-woocomme/54310492#54310492">Exclude variations with 2 specific attribute terms from coupon usage in Woocommerce</a>"</em> 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. </p>
  
  <p>But it also makes the coupon invalid <strong>for any other items added to the cart</strong>.</p>
  
  <p>So for example if the cart has 3 items in it:</p>
  
  <ul>
  <li>Item 1: has the attribute "Classic Frame" ==> Coupon is Not Valid for this Item</li>
  <li>Item 2: has the attribute "Box Frame" ==> Coupon is Not Valid for this Item</li>
  <li>Item 3: has the attribute "Loose" ==> Coupon should be VALID for this Item</li>
  </ul>
  
  <p>So what I would like is that the coupon discount is only applied to other items.</p>
  
  <p>Any help is really appreciated.</p>