Enqueue fragments only in the cart widget

This commit is contained in:
Mike Jolley 2022-11-09 16:14:34 +00:00
parent 91da0a15df
commit 35cd4518bb
2 changed files with 2 additions and 1 deletions

View File

@ -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();

View File

@ -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'] ) ) {