Another piece to the puzzle…
When a un-authenticated user adds-to-cart from either product archive and product detail pages and then navigates to the cart page, the cart shows up empty. However, when the user then logs in, the original products that where added appear in the cart.
Seems like the actual session was saved and then attached to the user once they authenticated.
Thanks,
Rudy
I ran into this bug the other day because I had DB Cache Reloaded Fix plugin installed. Once I removed it, everything was fine again.
Hi azn137:
Thanks for your reply. At this time I only have Woocommerce plugged in. I’ve even removed the theme and went with the Twenty Twelve theme to make sure I’ve removed any potential conflicts or overrides.
Does Woocommerce need you to first log in in order for the cart functionality to work properly? Not the checkout but just the ability to add a product to the cart.
Thanks
@rudygfl – no it doesn’t require you to be logged in.
Hi splashingpixels:
Thanks for your reply… Makes sense to me…
Thanks
I had exactly the same issue and it is a caching issue. If you use a caching program make sure that cart and checkout are excluded, don’t rely on woocommerce to exclude.
If this fails, which it did for me, try adding this code (without the descriptors):
Disabling Browser Cache in HTML
With this code placed in the top of the head section you can turn off client side caching.
<meta http-equiv=”cache-control” content=”max-age=0″ />
<meta http-equiv=”cache-control” content=”no-cache” />
<meta http-equiv=”expires” content=”0″ />
<meta http-equiv=”expires” content=”Tue, 01 Jan 1980 1:00:00 GMT” />
<meta http-equiv=”pragma” content=”no-cache” />
Disabling Server Side Cache in PHP
This little two liner code goes to the uppermost part of a PHP file.
<?php
header(“Cache-Control: no-cache, must-revalidate”); // HTTP/1.1
header(“Expires: Sat, 26 Jul 1997 05:00:00 GMT”); // Date in the past
?>
This worked for even though perhaps it shouldn’t of.
You can check out the working site at https://www.creightonscakes.co.uk/2013
edit: the ^&%^%$$ server seems to be having issues at the moment
Hi phildom:
Awesome!
I was leading down this path and had already sent an email to my hosting provider to have them work on this “potential” issue… no longer “potential” π
For the sake of documentation, my hosting service provider is WPEngine. WPEngine uses a custom caching solution, which includes W3 Total Cache. When I matched that up with a post on the WooTheme knowledge base (http://support.woothemes.com/entries/22714772-Problem-adding-items-to-shopping-cart-cart-is-empty) I started leaning in that direction.
With your post phildom I feel good about this solution. I’ll implement the changes you posted and in addition report back my results once WPEngine support tweets their custom caching solution.
Thanks for all your help!
Rudy
Problem solved…
phildon hit it right on the head… it issues were caused by a caching solution that my hosting provider uses. Once the exception rules were added all came well π
In my case I didn’t have to limit browser client side caching. The only thing that was needed was those exception rules being added. FYI I use WPEngine to host my websites. Here’s an article they have posted that might help someone else:
http://support.wpengine.com/wpengine-ecommerce/
Thanks for all the input
Rudy