title: Coupon with 2 different percentage discounts based on product category in Woocommerce
body: <p>I am looking for a Woocommerce hook that will help to change the discount percentage based on 2 different product category restrictions when a specific coupon is applied.</p>
  
  <p>For example if customer add a specific coupon I will like to:</p>
  
  <ol>
  <li>If a cart item is from product category A then it will give 10% discount on that item. </li>
  <li>if it's in product category B it will give 20% discount on that item</li>
  <li>Update total cart price </li>
  </ol>
  
  <p>Is there any hook that could be available to achieve this? Any available action hook or filter hook?</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>add_filter( 'woocommerce_get_discounted_price', 'apply_coupon', 10);
  function apply_coupon($price) {
       global $woocommerce;
       $product=$woocommerce-&gt;cart-&gt;product;
       if(has_term( 'duplex-blinds', 'A' ,$product-&gt;id)){
         get_product_cart_price; 
        10% DISCOUNT
       }
       if(has_term( 'duplex-blinds', 'A' ,$product-&gt;id)){
        20% DISCOUNT
       }
       upadte total_discunt_incart($new_discount);
       upadte new_price_in_cart($new_price);
       upadte new_price_in_checkout($new_price);
    return $price;
  }
  </code></pre>
  
  <p>The important thing is i need to  modify the <strong>total cart price</strong> , <strong>total checkout price</strong> , <em>total discount price</em> and discount price need to send to Paypal.</p>
  
  <p>My shop have many hooks that's why woo commerce default coupon calculation is going to wrong. And i noticed that in cart page discount price is coming correctly based on the custom product value, but it not get updated from the original cart amount, so the total price remain the same. </p>
  
  <p>But in checkout page discount price is calculated based on the product original price not the product custom price so the discount is coming wrong and also it is not minimize from the total price also...  </p>