If you have a WordPress site running WooCommerce, you may have wondered why an anonymous guest who adds items to his cart is told that the cart is empty even after having just added something to it. The site’s theme may even show some number of items in the cart in the page menu/header, but yet the cart page insists nothing is there. Meanwhile the “site-wide store notice text” that you can use to notify visitors of an important message also has disappeared for anonymous/Guest users. Both of these issues are caused by the same thing.
It’s all thanks to the plug-in WP Super Cache. When this is in use it causes Guest Checkout (WooCommerce Settings: Checkout Options “Enable Guest Checkout”) to malfunction, so that visitors can add items to their cart, but when they visit their Cart page, it says the cart is empty. Similarly, in WooCommerce Settings if you’ve checked “Enable site-wide store notice text,” the message will only appear to guests when WP Super Cache is disabled.
To test this yourself, go to the “Easy” tab in the WP Super Cache Settings, and choose “Caching Off” and then try checking out as guest. Suddenly you’ll be able to see the items you added to your cart.
I’m now using the Wordfence Falcon Engine caching and that seems to work fine. It’s not quite as fast as WP Super Cache, but it’s good enough for my purposes.
When I first encountered these problems I did a bit of searching around the ‘net and only found forum after forum of people asking for a solution, but with the threads closed due to inactivity, with no answers given. Hopefully someone will find this post before wasting too much time on those other dead ends. ;)