Skip to content

Instantly share code, notes, and snippets.

@NickGreen
Created July 19, 2018 15:31
Show Gist options
  • Save NickGreen/588b04b3817c0ede18f06cb3e1382d53 to your computer and use it in GitHub Desktop.
Save NickGreen/588b04b3817c0ede18f06cb3e1382d53 to your computer and use it in GitHub Desktop.
add_action('wp_footer','custom_jquery_add_to_cart_script');
function custom_jquery_add_to_cart_script(){
?>
<script type="text/javascript">
// Ready state
(function($){
$( document.body ).on( 'added_to_cart', function(){
console.log('EVENT: added_to_cart');
});
})(jQuery);
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment