{"id":6180144,"date":"2015-05-29T17:06:23","date_gmt":"2015-05-29T17:06:23","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/empty-cart-after-adding-products\/"},"modified":"2016-08-24T16:46:17","modified_gmt":"2016-08-24T16:46:17","slug":"empty-cart-after-adding-products","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/empty-cart-after-adding-products\/","title":{"rendered":"Empty cart after adding products."},"content":{"rendered":"<p>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.<\/p>\n<p>When I add products to the cart, then view cart it&#8217;s empty. I have done a lot of googling on this and have done the following:<\/p>\n<p>1 &#8211; There is NO caching plugin installed.<\/p>\n<p>2 &#8211; The host guarantees that session path is set correctly. (some people say that under &#8220;system status&#8221; page it lists the path, but on my version it doesn&#8217;t.)<\/p>\n<p>3 &#8211; All WC Pages are all set correctly.<\/p>\n<p>4 &#8211; WP memory is set to 64M on wp-config.php. <\/p>\n<p>5 &#8211; The php memory on php.ini is 128Mb<\/p>\n<p>6 &#8211; This is what&#8217;s in my php.ini:<\/p>\n<pre><code>post_max_size = 41M\nupload_max_filesize = 41M\nmemory_limit = 128M\nmax_execution_time = 200\nmax_input_time = 200\nmax_input_vars = 10000\nsuhosin.post.max_array_index_length = 256\nsuhosin.post.max_totalname_length = 65535\nsuhosin.post.max_vars = 10000\nsuhosin.request.max_array_index_length = 256\nsuhosin.request.max_totalname_length = 65535\nsuhosin.request.max_vars = 10000\nsession.save_path = \/tmp<\/code><\/pre>\n<p>7 &#8211; &#8220;Enable AJAX add to cart buttons on archives&#8221; is turned off<\/p>\n<p>8 &#8211; I&#8217;ve tested it logged as admin and logged out of wp-admin.<\/p>\n<p>9 &#8211; PHP is running as an Apache module on the server.<\/p>\n<p>10 &#8211; I have reset &#8220;WC Transients&#8221;, &#8220;Expired Transients&#8221;, &#8220;Term counts&#8221; and &#8220;Customer Sessions&#8221; until System Status &gt; Tools.<\/p>\n<p>11 &#8211; I have delete the sites cookies on my site, and the &#8220;woocommerce_cart_hash&#8221; &amp; &#8220;woocommerce_items_in_cart&#8221; are being resaved.<\/p>\n<p>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: \u00a30 then two links to cart and checkout.<\/p>\n<p>After I add to cart, I set the default &#8220;XYZ was successfully added to your cart. View Cart&#8221; message. BUT the header widget now only shows the two links \u2013 the sub total has vanished.<\/p>\n<p>Looking at the code in the &#8220;header-cart-info&#8221; div it was:<\/p>\n<pre><code>&lt;p id=&quot;noitems&quot; class=&quot;total&quot;&gt;\n\t&lt;strong&gt;Subtotal:&lt;\/strong&gt;\n\t&lt;span class=&quot;amount&quot;&gt;\u00a30&lt;\/span&gt;\n&lt;\/p&gt;\n&lt;div class=&quot;widget_shopping_cart_content&quot;&gt;\n\t&lt;p class=&quot;total&quot;&gt;\n\t\t&lt;strong&gt;Subtotal:&lt;\/strong&gt;\n\t\t&lt;span class=&quot;amount&quot;&gt;\u00a30&lt;\/span&gt;\n\t&lt;\/p&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p>now it&#8217;s:<\/p>\n<pre><code>&lt;p id=&quot;noitems&quot; class=&quot;total hidden&quot;&gt;\n\t&lt;strong&gt;Subtotal:&lt;\/strong&gt;\n\t&lt;span class=&quot;amount&quot;&gt;\u00a30&lt;\/span&gt;\n&lt;\/p&gt;\n&lt;ul class=&quot;cart_list product_list_widget &quot;&gt;\n\t&lt;li class=&quot;empty&quot;&gt;No products in the cart.&lt;\/li&gt;\n&lt;\/ul&gt;\n&lt;div class=&quot;widget_shopping_cart_content&quot;&gt;\n\t&lt;!-- end product list --&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p>Annoyingly as I write this it has started working across all my browsers \u2013\u00a0it 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&#8217;m sure it will happen again.<\/p>\n<p>Anyone with any thoughts?<\/p>\n<p>https:\/\/wordpress.org\/plugins\/woocommerce\/<\/p>\n","protected":false},"template":"","class_list":["post-6180144","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6180144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6180144\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6180144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}