title: Do not apply coupons if selected "Local Pickup"
body: <p>I use a code that adds a discount when choosing &quot;Local Pickup&quot; in the cart and at checkout.</p>
  <pre><code>/**
  * Discount for Local Pickup
  */
  add_action( 'woocommerce_cart_calculate_fees', 'custom_discount_for_pickup_shipping_method', 10, 1 );
  function custom_discount_for_pickup_shipping_method( $cart ) {
      if ( is_admin() &amp;&amp; ! defined( 'DOING_AJAX' ) )
          return;
  
      $percentage = 15; // Discount percentage
  
      $chosen_shipping_method_id = WC()-&gt;session-&gt;get( 'chosen_shipping_methods' )[0];
      $chosen_shipping_method    = explode(':', $chosen_shipping_method_id)[0];
  
      // Only for Local pickup chosen shipping method
      if ( strpos( $chosen_shipping_method_id, 'local_pickup' ) !== false ) {
  
          // Set variable
          $new_subtotal = 0;
  
          // Loop though each cart items and set prices in an array
          foreach ( $cart-&gt;get_cart() as $cart_item ) {
  
              // Get product
              $product = wc_get_product( $cart_item['product_id'] );
  
              // Product has no discount
              if ( ! $product-&gt;is_on_sale() ) {
                  // line_subtotal
                  $line_subtotal = $cart_item['line_subtotal'];
  
                  // Add to new subtotal
                  $new_subtotal += $line_subtotal;
              }
          }
  
          // Calculate the discount
          $discount = $new_subtotal * $percentage / 100;
  
          // Add the discount
          $cart-&gt;add_fee( __('Discount') . ' (' . $percentage . '%)', -$discount );
      }
  }
  </code></pre>
  <p>I also created several coupons. How can I change this code to exclude all coupons from the calculation when I select &quot;Local Pickup&quot;?</p>
  <p>How can you show a notice that coupons don't work when &quot;Local Pickup&quot; is selected?</p>
  <p>I would be glad to have your help!</p>