title: Woocommerce - Exempt VAT in Some Shipping Methods
body: <p>In case of shipping to specific countries we have a function that exempts VAT. However, we need to keep VAT in case the shipping method chosen is Local Pickup. Therefore, we have the following code:</p>
  <pre><code>add_action( 'woocommerce_checkout_update_order_review', 'disable_vat_local_pickup' );
    
  function disable_vat_local_pickup( $available_gateways ) {
      
     $chosen_methods = WC()-&gt;session-&gt;get( 'chosen_shipping_methods' );
     $chosen_shipping = $chosen_methods[0];
     if ( 0 === strpos( $chosen_shipping, 'local_pickup' ) ) {
         WC()-&gt;customer-&gt;set_is_vat_exempt( false );
         }     
  }
  </code></pre>
  <p>The problem is that it doesn't seem to work when the checkout page loads. If then i change the chosen shipping method it works fine.</p>