The Cart Fragments script, responsible for updating the cart widget after a successful add-to-cart event, can cause a performance issue on stores not making use of that functionality. To mitigate this, the script will now only be enqueued if using the Mini Cart widget.
This change was implemented with WooCommerce 7.8.
Stores with similar functionality (e.g. from a theme) that are not using the widget can re-enable this functionality by either adding the widget to one of their widget areas/sidebars or by enqueuing the script manually:
function enqueue_wc_cart_fragments() { wp_enqueue_script( 'wc-cart-fragments' ); }
add_action( 'wp_enqueue_scripts', 'enqueue_wc_cart_fragments' );
If you’re looking for an alternative to the Mini Cart widget that does not suffer from the performance issue, try the Mini Cart Block instead.
You can read more about this change below: