• Resolved qwik3r

    (@qwik3r)


    Kind of a silly question…but if you disable all Woocommerce scripts on say the homepage, will the cart still function? For instance if someone already had items in their cart, but on specific pages you disabled all Woocommerce scripts for performance. Not sure if it could grab the contents of their cart still and display it, or if some of the WC scripts have to be enabled.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Not a silly question at all!

    Some of the scripts are actually to improve performance: with the add to cart scripts, products can be added to the cart without reloading the page. Furthermore, they can help to replace dynamic elements (such as the menu cart item count) on pages that would otherwise be served statically from cache and thus would often show the wrong information.

    So it depends on your specific configuration (is AJAX add to cart enabled? Do you use server side caching?) whether disabling the scripts results in the menu cart being accurate or not. The cart itself does not need scripts AFAIK.

    Thread Starter qwik3r

    (@qwik3r)

    So if I disable all of my Woocommerce scripts then I’d imagine the cart would cease to function on that page?

    I have ajax add to cart enabled, and I’m just noticing a performance decrease with the cart fragments.

    My scenario is if someone is viewing a non integral page, like a blog post, homepage, etc but already has items in their cart, to be able to see the indicator of how many items they have BUT not have all of the Woocommerce scripts enabled, such as cart fragments. On pages that have add to cart buttons, obviously it would have all the scripts.

    Does that make sense and is that possible?

    Plugin Contributor Ewout

    (@pomegranate)

    Yes, that’s possible. But you won’t have the fragments, which means that if your pages are cached (server side), the cart element will not dynamically reflect the actual cart contents. If you don’t have server side caching then that should work fine. The proof is in the pudding ?? ??

    Thread Starter qwik3r

    (@qwik3r)

    Ok, great. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woocommerce scripts’ is closed to new replies.