Jannis M.
Jannis M.

Reputation: 89

Woocommerce - Cart Empty for Non Logged In Users

I have a problem in my Woocommerce shop. Not logged-in users can't add products in their cart! When they press the "add-to-cart-button", the products is added to the cart. But if they refresh the page or go to the cart, it is empty!

If I am logged-in, it is not happening and everything is working good.

Can someone please help?

Upvotes: 3

Views: 15504

Answers (5)

ajay
ajay

Reputation: 23

For me the issue was using "cart-2". WP-Engine does not cache "cart" but does for other pages. I changed the URL and it started working.

Upvotes: 0

Shubham Kumar
Shubham Kumar

Reputation: 1

It sounds like the website is behaving differently for logged in users vs. visitors – this won’t be affected by the “checkout without registering” option. This kind of problem is usually caused by either a conflict with your theme, Plugin or with Cache.

The best way to determine if the issue is being caused by a theme and/or plugin is to temporarily switch your theme to Storefront and disable all plugins except for WooCommerce. A good way to do this is with a free plugin called Meks Quick Plugin Disabler ( https://wordpress.org/plugins/meks-quick-plugin-disabler/ ), which will remember what plugins you currently have active so it’s easy to switch back. If that resolves the issue, then slowly re-enable features until you find the one that’s causing the conflict.

Please follow this link for Cache full detail: https://businessbloomer.com/woocommerce-solving-cart-empty-issue/

Upvotes: 0

kolli
kolli

Reputation: 1290

In case anybody else runs into this: hosting providers like WP Engine make extensive use of caching to improve the performance of your webshop. Although, they're excluding pages where this is not desired, like the cart or checkout page.

They do this for the default paths (/cart, /checkout) only, though. So if you change the default path to adapt the URLs to your language of choice, for example, make sure to write to their support so they can add exceptions for your pages.

See here for a description of this issue from WP Engine.

Upvotes: 1

Charlie H
Charlie H

Reputation: 31

I had this problem. For me, I realised it was because the session_id column in the wp_woocommerce_sessions table was not auto incrementing. After I modified the table, it worked.

Upvotes: 3

Faysal Haque
Faysal Haque

Reputation: 410

I think the problem is in your server configuration. If you use any caching plugin deactivate it and hard refresh your browser. Then check again if it works or not?

Here is an article Mike Jolley wrote: http://mikejolley.com/2013/12/20/problems-with-cart-sessions-and-woocommerce/

Upvotes: 3

Related Questions