title: Woocommerce trigger the "order review" update in checkout page
body: <p>I'm using the <a href="https://jeroensormani.com/woocommerce-advanced-shipping/" rel="nofollow noreferrer">Woocommerce Advanced Shipping plugin</a> by Jeroen Sormani for the shipping methods and the <a href="https://wordpress.org/plugins/woocommerce-pay-for-payment/" rel="nofollow noreferrer">WooCommerce Pay for Payment plugin</a> by Karolína Vyskočilová to add a €5 fixed fee to the "cash on delivery" payment method.</p>
  
  <p>Using the Advanced Shipping Plugin, I also created a general rule called "Local pickup" to be always visible to the customers. Then I needed to hide the "cash on delivery" payment method when the "local pickup" shipping option is selected. To achieve this I had to add some code to my functions.php file in order to identify the specific local pickup rule inside the advanced shipping rules:</p>
  
  <pre class="lang-php prettyprint-override"><code>function my_custom_available_payment_gateways( $gateways ) {
      $chosen_shipping_rates = WC()-&gt;session-&gt;get( 'chosen_shipping_methods' );
      // When 'local pickup' (rule id 21828) has been chosen as shipping rate
      if ( in_array( '21828', $chosen_shipping_rates ) ) :
          // Unset 'cash on delivery'
          unset( $gateways['cod'] );
      endif;
  return $gateways;
  }
  add_filter( 'woocommerce_available_payment_gateways', 'my_custom_available_payment_gateways' );
  </code></pre>
  
  <p>Here is my problem: In the checkout page, when I switch to "local pickup", the "cash on delivery" option disappears as said before, but the €5 fee in the order review table stays there. I have to manually switch the payment method again (i.e. from bank transfer to credit card) in order to make the fee disappear.</p>
  
  <p>I need to find some solution to trigger the order review update/refresh when the local pickup is selected.</p>
  
  <p>I tried inserting the following script in the checkout page with no success</p>
  
  <pre class="lang-php prettyprint-override"><code>function woocommerce_add_update_cart() {
      // Only on checkout page
      if( ! is_checkout() ) return;
      ?&gt;
      &lt;script type="text/javascript"&gt;
      jQuery(document.body).trigger("update_checkout");
      &lt;/script&gt;
      &lt;?php
  }
  add_action( 'wp_footer', 'woocommerce_add_update_cart' );
  </code></pre>