title: WooCommerce - reload the order on click of a button via Ajax
body: <p>I'm adding a 'Remove' button next to each item in the Order via this function in functions.php:</p>
  
  <pre><code>add_action( 'woocommerce_order_item_meta_end', 'display_remove_order_item_button', 10, 3 );
  function display_remove_order_item_button( $item_id, $item, $order ){
      // Avoiding displaying buttons on email notification
      if( ! ( is_wc_endpoint_url( 'view-order' ) || is_wc_endpoint_url( 'order-received' ) ) ) return;
  
      if( isset($_POST["remove_item_$item_id"]) &amp;&amp; $_POST["remove_item_$item_id"] == 'Remove this item' ){
          wc_delete_order_item( $item_id );
      }
  
      echo '&lt;form class="cart" method="post" enctype="multipart/form-data" style= "margin-top:12px;"&gt;
      &lt;input type="submit" class="button" name="remove_item_'.$item_id.'" value="Remove this item" /&gt;
      &lt;/form&gt;';
  }
  </code></pre>
  
  <p>The issue is, after clicking the Remove button you then have to refresh the order page in order for the item to disappear.</p>
  
  <p>I'd like that to happen automatically. I suppose I need to use Ajax to call the above function, but not quite sure how to do that.</p>
  
  <p>Thanks in advance</p>