title: Which method or action hook is fired when changing shipping method on checkout page?
body: <p>I need to change the address fields to be 'required', when the user will select shipping method that is other than "local pickup".</p>
  
  <p>I managed make it optional by default (local pickup is selected by default) using a filter, like this:</p>
  
  <pre><code>add_filter( 'woocommerce_checkout_fields', 'disable_required_address_shipping' );
  
  function disable_required_address_shipping($fields ) {
      if ( check_if_local_pickup() ) {
  
          $fields['billing']['billing_address_1']['required'] = false;
          $fields['billing']['billing_address_2']['required'] = false;
          $fields['billing']['billing_city']['required'] = false;
      }
  
      return $fields;
  
  }
  
  function check_if_local_pickup() {
      $chosen_methods = WC()-&gt;session-&gt;get( 'chosen_shipping_methods' );
      $chosen_shipping = $chosen_methods[0]; 
      if ($chosen_shipping == 'local_pickup') { 
          return true;
      }
  }
  </code></pre>
  
  <p>But I need to change it dynamically using an action.</p>
  
  <p>I tried to look for a solution here and couldn't find one. </p>
  
  <p>Is there any action that fires when changing shipping method? <br>
  Any ideas?</p>