title: Coupon discount on product regular price (not sale price)
body: <p>In WooCommerce, I have products with a regular price of X and a sales price of Y. I would like to add a coupon with a code for a $45.00 discount to be taken from the regular price X. </p>
  
  <p>I would like the coupon to disregard the sale price so I get X-$45  <strong>NOT</strong>  Y-$45. But when the coupon is not applied price Y is used. </p>
  
  <p>I found the following which works for percentage discounts, but I can't seem to make it work for a fixed product discount price. </p>
  
  <pre><code>add_filter('woocommerce_coupon_get_discount_amount', 'woocommerce_coupon_get_discount_amount', 10, 5 );
  function woocommerce_coupon_get_discount_amount( $discount, $discounting_amount, $cart_item, $single, $coupon ) {
      if ($coupon-&gt;type == 'percent_product' || $coupon-&gt;type == 'percent') {
          global $woocommerce;
          $cart_total = 0;
  
          foreach ( $woocommerce-&gt;cart-&gt;get_cart() as $cart_item_key =&gt; $cart_item ) {
  
           $variable_product1= new WC_Product_Variation( $cart_item["variation_id"] );
  
           $cart_total += $variable_product1 -&gt;regular_price * $cart_item['quantity'];
          } 
          $discount = round( ( $cart_total / 100 ) * $coupon-&gt;amount, $woocommerce-&gt;cart-&gt;dp );
          return $discount;
      }
      return $discount;
  }
  </code></pre>