• Hi,

    How do I disable (I do not use the cart on my page). I installed woocommerce in combination with ProjectYellow theme and do not use the cart. To speed up loading of the page I would like to disable …/assets/js/frontend/cart-fragments.min.js?ver=2.0.20?. How do I do this? Which file calls this script?

    Thanks!
    Syl

    https://wordpress.org/plugins/woocommerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Roy Ho

    (@splashingpixelscom)

    Put this in your theme’s functions.php file.

    wp_dequeue_script( 'wc-cart-fragments' );
    Thread Starter Syllogic

    (@syllogic)

    Hi, thanks for responding!

    Is there a specific line I have to add this to? I added it but cart-fragments.min.js?ver=2.0.20? still runs.

    Roy Ho

    (@splashingpixelscom)

    Well you need to put it into an action and put it inside your theme’s functions.php file like this.

    add_action( ‘wp_print_scripts’, ‘de_script’, 100 );
    
    function de_script() {
        wp_dequeue_script( 'wc-cart-fragments' );
    
        return true;
    }
    Thread Starter Syllogic

    (@syllogic)

    Thanks again… I am a newb…

    Pasted it in the functions.php but the script still runs 🙁

    Roy Ho

    (@splashingpixelscom)

    Actually the quotes are not correct from copying and pasting. Try this:

    add_action( 'wp_print_scripts', 'de_script', 100 );
    
    function de_script() {
        wp_dequeue_script( 'wc-cart-fragments' );
    
        return true;
    }

    I’ve tested this and it works.

    Thread Starter Syllogic

    (@syllogic)

    Yes! It works! Thanks so much for your help!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to disable cart-fragments.min.js?ver=2.0.20?’ is closed to new replies.