title: Modify Shipping in Woocommerce cart
body: <p>I have three countries where I will deliver the goods. I want the client to select the country first and see the delivery methods without updating the entire page, and without using the Update Totals button. Just choose the country and drop shipping options.</p>
  
  <p>This code is i tried but its not working for me.</p>
  
  <pre><code>add_filter('woocommerce_package_rates', 'wf_modify_rates', 10, 3); 
  function wf_modify_rates($available_shipping_methods, $package){ 
      $methords_us = array('flaterate:1','flaterate:2'); 
      if( $package['destination']['country'] == 'US'){ 
          foreach ($available_shipping_methods as $methord_name =&gt; $methord) {
              if(!in_array($methord_name, $methords_us)){
                  unset($available_shipping_methods[$methord_name]); 
              } 
          } 
      } return $available_shipping_methods; 
  }
  </code></pre>