1add_action('wp_footer','custom_jquery_add_to_cart_script');
2function custom_jquery_add_to_cart_script(){
3 if ( is_shop() || is_product_category() || is_product_tag() ): // Only for archives pages
4 ?>
5 <script type="text/javascript">
6 // Ready state
7 (function($){
8
9 $( document.body ).on( 'added_to_cart', function(){
10 console.log('EVENT: added_to_cart');
11 });
12
13 })(jQuery); // "jQuery" Working with WP (added the $ alias as argument)
14 </script>
15 <?php
16 endif;
17}