• Resolved aretehemp

    (@aretehemp)


    For some reason this plugin does not seem to disable WooCommerce cart fragments on our site. We do also use the WP Rocket plugin and a child theme not sure if either of those will be relevant to this or not. We recently had a big release and we noticed this issue had not been solved like we thought it was. Thank you for any help.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimocha

    (@optimocha)

    Hi @aretehemp,

    Checking your website, I see that the plugin is working properly and the cart fragments script doesn’t load until the visitor adds a product to cart. Can you confirm you’re testing your website in Incognito mode and with an empty cart?

    Thread Starter aretehemp

    (@aretehemp)

    Hmm ok I guess that is good news. It seems the load being generated by the fragments is still too much for the server to handle under a big load. Is there any way we can further optimize this using your plugin?

    Plugin Author Optimocha

    (@optimocha)

    @aretehemp DCF only disables the cart fragments script if users don’t add stuff to their carts (and load the script if they do add things to cart) but you can disable the cart fragments script completely by somehow utilizing the code below (either pasting it under your theme’s functions.php file or using a snippets plugin like Code Snippets):

    /** Disable Ajax Call from WooCommerce */
    function sert_dequeue_woocommerce_cart_fragments() {
    wp_dequeue_script('wc-cart-fragments');
    }
    add_action( 'wp_enqueue_scripts', 'sert_dequeue_woocommerce_cart_fragments', PHP_INT_MAX);

    However, it will ensure that your cart icon will break and show “0” even though the cart is not empty (because that’s exactly what that cart fragments script does–to update the cart icon with the information fragment of the number of cart items).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fragments Not Disabled’ is closed to new replies.