Created
November 21, 2022 06:35
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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