diff --git a/plugins/woocommerce/includes/class-wc-frontend-scripts.php b/plugins/woocommerce/includes/class-wc-frontend-scripts.php index 4ddbb076061..d95833aa819 100644 --- a/plugins/woocommerce/includes/class-wc-frontend-scripts.php +++ b/plugins/woocommerce/includes/class-wc-frontend-scripts.php @@ -430,7 +430,6 @@ class WC_Frontend_Scripts { // Global frontend scripts. self::enqueue_script( 'woocommerce' ); - self::enqueue_script( 'wc-cart-fragments' ); // CSS Styles. $enqueue_styles = self::get_styles(); diff --git a/plugins/woocommerce/includes/widgets/class-wc-widget-cart.php b/plugins/woocommerce/includes/widgets/class-wc-widget-cart.php index cc76280b5a7..0d33873c5cc 100644 --- a/plugins/woocommerce/includes/widgets/class-wc-widget-cart.php +++ b/plugins/woocommerce/includes/widgets/class-wc-widget-cart.php @@ -56,6 +56,8 @@ class WC_Widget_Cart extends WC_Widget { return; } + wp_enqueue_script( 'wc-cart-fragments' ); + $hide_if_empty = empty( $instance['hide_if_empty'] ) ? 0 : 1; if ( ! isset( $instance['title'] ) ) {