Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

woocommerce cart is empty after adding products

I use woocommerce on wordpress. But have one problem with checkout page. I'm adding products to the cart, then it redirects to cart page(as I checked this option from Woocommerce Settings-> "Redirect to the cart page after successful addition"), in the cart page I have "Update Cart" and "Proceed to checkout" buttons, after clicking on both buttons I'm redirected to Empty Cart page.

I noticed a thing that cart is updated after some minutes and after that it works. What can cause this maybe cookie or session issue?

like image 486
aiddev Avatar asked Mar 03 '15 07:03

aiddev


People also ask

Why does my shopping cart empty?

Some browsers allow you to clear the cache or cookies at the start of a new browser session, such as quitting the browser or closing a browser window. This can remove the shopping cart contents, because the cookies are gone.

Is cart empty WooCommerce?

We can do our check by using the WC() global function and getting the cart contents count. While there are several ways we could check this, I prefer this method since it returns as an integer, so we simply need to check if it's equal to zero to determine if the cart is empty.

Why is my add to cart not working?

Plugin or theme conflict is one of the most common reasons for Add to Cart button not working error. The more plugins you use on your website the more compatibility issues you will face. So when you face the error the first thing you need to check is to plugin or theme conflict.


2 Answers

The most simple solution:

Go to settings, change from "https" to "http", try it now, if it works there is a issue with woocommerce forcing autentication, you can simply leave it be, and use "Wp Force SSL" to keep runing the SSL certification and have no more problems with it.

Worked for me

like image 55
brunocorreiagomes Avatar answered Sep 18 '22 02:09

brunocorreiagomes


I ran into this problem and tried a bunch of things: - installing a session plugin - updating woocommerce & theme - updating wordpress - updating my plesk server - adding session.autostart = 0 in PHP.ini - using expiresActive Off in .htaccess - removing AJAX on products and REST API in woocommerce settings - refreshing status in woocommerce system status

The one thing that finally worked for me (i think) was installing WP Force SSL

this sounds like an ad. I hope this helps!

like image 21
AshAndrien Avatar answered Sep 20 '22 02:09

AshAndrien