title: Remove product in the custom cart using ajax in woocommerce
body: <p>I have a problem removing products from the cart. My code removes the product in ajax but does not refresh the cart. This is my code:</p>
  
  <pre><code>add_filter('woocommerce_add_to_cart_fragments','woocommerce_header_add_to_cart_fragment'); function woocommerce_header_add_to_cart_fragment( $fragments ) {
  global $woocommerce;
  $cart = $woocommerce-&gt;cart-&gt;cart_contents;
  ob_start();
  $cart_count = sprintf(_n('%d', $woocommerce-&gt;cart-&gt;cart_contents_count, 'woothemes'), $woocommerce-&gt;cart-&gt;cart_contents_count);
  ?&gt;
  &lt;div data-toggle="dropdown" class="cart-customlocation" [...] ?&gt;&lt;/span&gt;
      &lt;div class="dropdown-menu custom-cart"&gt;
  
          &lt;?php  foreach($cart as $cart_item_key =&gt; $item){ ?&gt;
  
              &lt;?php $img_url = $item['data']-&gt;image_id; ?&gt;
              &lt;img src="&lt;?php echo wp_get_attachment_url( $img_url ); ?&gt;" alt=""&gt;  
              [...] &lt;- content
              &lt;a  class="remove-product" data-product_id="&lt;?php echo $cart_item_key ?&gt;"&gt;X&lt;/a&gt;
          &lt;?php } ?&gt;
          &lt;script type="text/javascript"&gt;
              jQuery('.remove-product').click(function(){
                  var product_id = jQuery(this).attr("data-product_id");
                  console.log(product_id);
                  jQuery.ajax({
                      type: 'POST',
                      dataType: 'json',
                      url: "myURL",
                      data: { action: "product_remove", 
                              product_id: product_id
                      },success: function(data){
                      }
                  });
                  return false;
              });
          &lt;/script&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;?php $fragments['.cart-customlocation'] = ob_get_clean();
  return $fragments;
  </code></pre>
  
  <p>AND this is a function called in ajax:</p>
  
  <pre><code>function product_remove() {
  
  global $woocommerce;
  
  $id = $_POST['product_id'];
  
  $woocommerce-&gt;cart-&gt;remove_cart_item($id);}
  </code></pre>