3
votes

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?

6
Can I see it on live ?Rohil_PHPBeginner
I am not able to make it work the way you are saying ...And one more thing I noticed that even if you just refresh the page after adding product to cart, it will show up empty cart .. So my guess is it is not product into the cart in actually.Rohil_PHPBeginner
@Rohil_PHPBeginner I have changed my question did you see the detail that I mentioned?aiddev
Yes .. But if you check in network in admin-ajax.php after adding product to cart, you will notice that in reposnse it is giving you the empty cart .. So product is not actually added to the cart. Reason could be(as you updated question), somewhere there must be timeout is set ..Rohil_PHPBeginner
What does it give you if you use default way to add products ? I mean without passing ?add-to-cart parameter ..Rohil_PHPBeginner

6 Answers

5
votes

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

1
votes

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!

0
votes

You are 18 versions behind. https://wordpress.org/plugins/woocommerce/changelog/

Your WordPress version is also behind. You should update both of them before continuing to try and figure out the problem.

As you can see by the change log link I posted there are a ton of fixes you are missing by not being updated.

0
votes

I did debug it and the issue was

woocommerce_sessions: Table does not exist

Deactivate and reactive the plugin, so that woocommerce plugin create a session table again.

0
votes

check the tick mark for Force secure checkout on woocommerce >> setting >> checkout.

If you have https secure certificate it should ticked (marked).

0
votes

For some reason, sometimes you add products to cart but the cart page stays empty (even if you can clearly see the cart widget has products). But don’t worry – it might just be a simple cache issue (and if you don’t know what cache is that’s no problem either).

Please follow this link for full detail: https://businessbloomer.com/woocommerce-solving-cart-empty-issue/