title: WooCommerce mini cart event trigger
body: <p>Every time a product is added to the basket by ajax and the mini cart is refreshed I need to be able to run some jQuery. I can't just simply create an even for add to cart because, I run some jQuery that checks if the mini cart has products inside it, but the add to cart even runs before the mini cart has added the products. This means that my if statement becomes false.</p>
  
  <p>What can I do about this apart from creating a timeout in jQuery?</p>
  
  <p>Here is the code I have modified from the current answers;  </p>
  
  <pre><code>add_action( 'wp_footer', 'ajax_add_tocart_event' );
  
  function ajax_add_tocart_event() {
      ?&gt;
       &lt;script type="text/javascript"&gt;
         jQuery( 'body' ).on( 'added_to_cart', function() {
              if( $('#mini_wrap .cart_list').length ){
                  alert('hi');
              }
         } );
      &lt;/script&gt;
      &lt;?php
  }
  </code></pre>