dhawalshah
dhawalshah

Reputation: 53

WooCommerce Does Not Allow Adding Products To Cart Unless Logged In

This problem occurred recently - if I am not logged into Wordpress, I am not able to add products to my WooCommerce cart. It redirects to the cart page as it should but shows 'Cart Empty'. Works perfectly when I am logged in as a user in any role. I searched around and found this thread: http://wordpress.org/support/topic/plugin-woocommerce-cart-brokennot-adding-products

I've tried changing my session folder with a custom php.ini file but the problem is still persisting. I used Duplicator and set up an instance on my localhost - where it works without issues, so that tells me the problem isn't with the theme or the plugins. What other issues with hosting could be causing this?

Upvotes: 2

Views: 6191

Answers (2)

Lu CT
Lu CT

Reputation: 116

I just fixed this and for me it was a just an extra empty line in the beginning of the functions.php file. Check the error logs on your root folder and there should appear some error that could give you a hint where the problem is.

Upvotes: 0

Michael Romrell
Michael Romrell

Reputation: 1015

For me the error was caused by Rackspace's "Varnish" script. it's a server-side caching tool that they use. I don't have more details than than. but once I alerted Rackspace, they fixed it pretty fast.

Upvotes: 1

Related Questions