Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AshlinRejo/c696e70e37ab09535b644a2239323c3c to your computer and use it in GitHub Desktop.
Save AshlinRejo/c696e70e37ab09535b644a2239323c3c to your computer and use it in GitHub Desktop.
Discount rules v2: Fix for Mini cart doesn't refresh in Floating Sticky Cart for WooCommerce
add_action('wp_footer','woo_disocunt_rules_slide_cart_fix');
function woo_disocunt_rules_slide_cart_fix(){
?>
<script type="text/javascript">
// Ready state
(function($){
$( document.body ).on( 'added_to_cart removed_from_cart', function(){
jQuery( document.body ).trigger( 'wc_fragment_refresh' );
jQuery( document.body ).trigger( 'wc_fragment_refresh' );
});
})(jQuery);
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment