WooCommerce + Roots Stack – BUGGY Cart

Not sure what’s happening here and can’t seem to find much online about it.

I have a client site where random items are being added to carts, including my own. It seems as though the cart is “global” and any items added to the cart by anybody are being added to everybody’s cart including my own account. Random items keep popping in to my cart.

It’s not ideal as they have just dropped a large amount of new stock and have had a decent spike in traffic.

Any ideas?

1 Like

I doubt it’s an issue related to a Roots product. Nobody else has ever described this issue as far as I know, and quite a few Roots users pair our products with WooCommerce.

Try disabling all of your plugins and then re-enabling them one at a time until the problem is reintroduced.

From the description, this would sound like a caching issue. So check your headers and disable anything that offers caching.

I thought it was something cache related too. Here is the only caching set up I have running on this installing, which is defined in my group_vars.

enabled: true
duration: 120s
skip_cache_uri: /wp-admin/|/xmlrpc.php|wp-..php|/feed/|index.php|sitemap(_index)?.xml| "/store.|/cart.|/my-account.|/checkout.|/addons.*
skip_cache_cookie: comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in

Previously none of my WooCommerce pages were in the skip cache, and I think this could have been causing the issue.

Will report back when I’m done. Could be useful for noobs like myself in future.

If you’re still having problems, try adding the WooCommerce specific cookies to skip_cache_cookie

1 Like

Thanks Emzo,

I’d actually already reached this point myself but appreciate your help :slight_smile:

I guess it’s good to note for anyone hoping to get WooCommerce working glitch free with FastCGI Caching

skip_cache_uri: /wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml|* "/store.*|/cart.*|/my-account.*|/checkout.*|/addons.*
skip_cache_cookie: comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_cart_hash|woocommerce_items_in_cart|wp_woocommerce_session_

Let me revive this old thread just real quick and ask for the reason of having /store.* in skip_cache_uri?

I get the cart, checkout, etc. URIs there, but can’t right now reproduce problems without store (or shop or whatever it might be called).