Sometimes you may need to refresh WooCommerce cart fragments so the changes show properly. For example, if you’ve added custom code and the cart isn’t updating right away.
In that case, you can easily refresh the cart fragments using a simple jQuery event. It’s a quick and effective way to make sure everything updates as expected.
See the code below:
$( document.body ).trigger( 'wc_fragment_refresh' );
You can listen to the wc_fragment_refresh event, which is a custom event triggered by WooCommerce.
By targeting this event, you can run your own code whenever the cart fragments are refreshed. It’s a simple and reliable way to hook into WooCommerce’s cart update process.
If you’d like to completely disable the WooCommerce cart fragments, check out my other article here.



