title: Shipping calculator auto update on country change in WooCommerce cart
body: <p>I woulk like to calculate on Woocommerce shipping cost based on country without clicking &quot;Update button&quot;.</p>
  <p>I checked posts on forums but it did not work for me:
  <a href="https://stackoverflow.com/questions/62006414/shipping-calculator-state-field-change-trigger-update-in-woocommerce-cart">Shipping calculator state field change trigger update in WooCommerce cart</a></p>
  <p>Can someone help with it?</p>
  <p>here is code I have right now:</p>
  <pre><code>// 1 Disable State
  add_filter( 'woocommerce_shipping_calculator_enable_state', '__return_false' );
   
  // 2 Disable City
  add_filter( 'woocommerce_shipping_calculator_enable_city', '__return_false' );
   
  // 3 Disable Postcode
  add_filter( 'woocommerce_shipping_calculator_enable_postcode', '__return_false' );
  
  
  add_action('wp_footer', 'cart_country_update_shipping_methods', 50);
  function cart_country_update_shipping_methods() {
      if ( ! is_cart() ) return; // On cart
      ?&gt;
      &lt;script type='text/javascript'&gt;
          jQuery(function($){
              $(document.body).on('change', 'select[name=&quot;calc_shipping_country&quot;]', function(){
                  $(this).submit();
              });
          });
      &lt;/script&gt;
      &lt;?php
  }
  </code></pre>
  <p><a href="http://www.zGruzie.cz" rel="nofollow noreferrer">www.zGruzie.cz</a> -- this web.</p>