Empty cart after adding products.
-
This is a sporadic issue that keeps re-occuring. At the moment 7 out of 8 browsers (Chrome on osX has the best results). It also works on my phone.
When I add products to the cart, then view cart it’s empty. I have done a lot of googling on this and have done the following:
1 – There is NO caching plugin installed.
2 – The host guarantees that session path is set correctly. (some people say that under “system status” page it lists the path, but on my version it doesn’t.)
3 – All WC Pages are all set correctly.
4 – WP memory is set to 64M on wp-config.php.
5 – The php memory on php.ini is 128Mb
6 – This is what’s in my php.ini:
post_max_size = 41M upload_max_filesize = 41M memory_limit = 128M max_execution_time = 200 max_input_time = 200 max_input_vars = 10000 suhosin.post.max_array_index_length = 256 suhosin.post.max_totalname_length = 65535 suhosin.post.max_vars = 10000 suhosin.request.max_array_index_length = 256 suhosin.request.max_totalname_length = 65535 suhosin.request.max_vars = 10000 session.save_path = /tmp
7 – “Enable AJAX add to cart buttons on archives” is turned off
8 – I’ve tested it logged as admin and logged out of wp-admin.
9 – PHP is running as an Apache module on the server.
10 – I have reset “WC Transients”, “Expired Transients”, “Term counts” and “Customer Sessions” until System Status > Tools.
11 – I have delete the sites cookies on my site, and the “woocommerce_cart_hash” & “woocommerce_items_in_cart” are being resaved.
What I have noticed, which may or may not be related, is that in the header bar I have the cart widget. So before I add anything it show a cart graphic subtitle: £0 then two links to cart and checkout.
After I add to cart, I set the default “XYZ was successfully added to your cart. View Cart” message. BUT the header widget now only shows the two links – the sub total has vanished.
Looking at the code in the “header-cart-info” div it was:
<p id="noitems" class="total"> <strong>Subtotal:</strong> <span class="amount">£0</span> </p> <div class="widget_shopping_cart_content"> <p class="total"> <strong>Subtotal:</strong> <span class="amount">£0</span> </p> </div>
now it’s:
<p id="noitems" class="total hidden"> <strong>Subtotal:</strong> <span class="amount">£0</span> </p> <ul class="cart_list product_list_widget "> <li class="empty">No products in the cart.</li> </ul> <div class="widget_shopping_cart_content"> <!-- end product list --> </div>
Annoyingly as I write this it has started working across all my browsers –?it has been not working for the past 8 hours (that I know of). This is the second time, that I know of, that we have had this issue and I’m sure it will happen again.
Anyone with any thoughts?
- The topic ‘Empty cart after adding products.’ is closed to new replies.