In functions.php
add_action('wp_footer','custom_jquery_add_to_cart_script');
function custom_jquery_add_to_cart_script(){
if ( ICL_LANGUAGE_CODE=='se' ): // eventueel indien bepaalde taal (WPML)
?>
<script type="text/javascript">
// Ready state
(function($){
$( document.body ).on( 'added_to_cart', function(){
//console.log('EVENT: added_to_cart');
location.reload();
});
})(jQuery); // "jQuery" Working with WP (added the $ alias as argument)
</script>
<?php
endif;
}
#add #cart #functions #shop #to #woocommerce