woocommerce cart is empty after adding products - wordpress

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?

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

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!

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.

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.

check the tick mark for Force secure checkout on woocommerce >> setting >> checkout.
If you have https secure certificate it should ticked (marked).

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/

Related

W3 Total Cache and Woocommerce with Storefront theme: product-categories cache is not updated

I am using W3 Total Cache on a Woocommerce website with the default Storefront theme and I am experiencing dificulties with product category pages (listings of products belonging to one product category).
If I add a product to a category, I will see it updated on the page (since I am logged in as admin and the option to disable cache for admins is enabled).
However, if I use another browser as guest, I will not see the new products, but instead a cached page server by W3TC. Something is preventing the cache plugin to "see" that the product category page was updated and therefore the need to regenerate the cache of that page.
To manually try to fix this:
I have tried clearing by browser cache and forcing the deletion of that page cache (under the admin bar > performance > purge current page) and it doesn't work.
Using "Purge All Caches" or "Purge Modules > Page Cache: All" does work, but the idea is just to purge the updated page and not all pages.
Any insights on solving this issue are appreciated. Thank you.
You can add those category pages in Performance>Page Cache>Advnaced. There you can find a lot of options, so you can choose the one that best suits you. Don’t cache the following pages or Never cache pages associated with these categories are one of the options that may help you with your issue.
Also, you can check on the page cache settings tab to be sure that the "Post terms pages" option is checked. There you can find so many options which might be helpful.
There is a tutorial on Woocomerce on how to set up W3TC with Wocommerce which you can find here.
You can also find directions for your issue on W3TC blog here.
I hope this helps
Do let me know if this helps.

How to Prevent Cart from clearing on registration in Woocommerce?

If a user adds a product to card, then goes to account page and registers a new account, the product(s) in the cart are automatically removed. How to prevent this behavior?
Try following these debugging steps:
https://businessbloomer.com/woocommerce-solving-cart-empty-issue/
Fix 1. Make sure there is no “red alert” under WooCommerce / System Status
Fix 2. Click the following buttons under WooCommerce / System Status / Tools
Fix 3. Check your Theme, WooCommerce & WordPress are using updated, compatible versions
Some premium themes won’t notify you if there is an update available. You have to make sure you’re using the latest, Woo-compatible version. Check with your theme vendor, plugin developers and see if anything has been reported.
For example, you might have updated WooCommerce too soon – sometimes premium plugins/themes require a few days/weeks before they can adapt to the new changes (if major) and become 100% compatible.
Fix 4. Save (flush) your permalinks
Go to WordPress/Settings/Permalinks and click on “save”. This should flush the permalinks and give you a chance to test the cart again.
Fix 5. Check you have no spaces in your checkout end-points
Go to WooCommerce/Settings/Checkout and make sure you have no spaces in your end-points. This happened to a client a while ago and it too me ages to find out (who would think the permalinks had been changed?):
WooCommerce Checkout Endpoints
Fix 6. Properly set up your WordPress cache plugin
Cart and Checkout pages should not be cached – if your WordPress cache plugin is for some reason caching WooCommerce pages, your cart will probably show as empty. Make sure to select a WooCommerce-compatible cache plugin 🙂
Also: ask your hosting to disable or properly set up server cache
Some hosts have their own cache system and this is sometimes applied to your website by default. Create a ticket or give them a quick call to find out if they have anything like that and if they can disable that as soon as possible.
For example: WPEngine uses its own cache. This might affect your WooCommerce Cart. Please contact support so they can create a caching exception list for WooCommerce and/or ajax files
Fix 7. Disable all plugins but WooCommerce
This is a typical troubleshooting operation. Disable all plugins and see if the Cart is back functioning. If YES, reactivate one plugin at a time and test the Cart again. As soon as you find the “guilty” plugin – yay! – time to substitute that plugin or see if there is an update available!
Fix 8. Try switching to a default WordPress Theme (e.g. TwentySixteen)
This is to prove the error is not theme-related. You won’t lose any content if you switch between themes, so don’t worry. If the error goes away, then check with your theme developers and report the bug 🙂

Woocommerce - Billing / shipping address doesn't update in My Account

I'm facing a little weird problem: when I change the billing or shipping address inside My Account screen, the address seems to have changed, however after refresh the page, the old address remains there and I look at the admin and check that anything was changed.
Have you ever seen that issue before? My theme still uses Woocommerce 1.6.4 because we're working on a new theme development and we can't update WC yet.
Any helps?
This has happened to me before. The problem was the WP Super Cache Plugin. The document below on the Woocommerce website explains why this happens. The cart, my account, and checkout page need to stay dynamic since they display information specific to the current customer.
https://docs.woothemes.com/document/configuring-caching-plugins/
If you aren't using a caching plugin, try clearing out your browser cache. If that doesn't fix the issue, I would revert back to the basics. Updating Woocommerce would be highly recommended, but in your case, I would disable any new plugins you have added. Since you are using an old version of Woocommerce, any new plugins added could be creating a conflict. I hope that helps!

WooCommerce Does Not Allow Adding Products To Cart Unless Logged In

This problem occurred recently - if I am not logged into Wordpress, I am not able to add products to my WooCommerce cart. It redirects to the cart page as it should but shows 'Cart Empty'. Works perfectly when I am logged in as a user in any role. I searched around and found this thread: http://wordpress.org/support/topic/plugin-woocommerce-cart-brokennot-adding-products
I've tried changing my session folder with a custom php.ini file but the problem is still persisting. I used Duplicator and set up an instance on my localhost - where it works without issues, so that tells me the problem isn't with the theme or the plugins. What other issues with hosting could be causing this?
For me the error was caused by Rackspace's "Varnish" script. it's a server-side caching tool that they use. I don't have more details than than. but once I alerted Rackspace, they fixed it pretty fast.

Strange session issue with Woocommerce

I'm trying to get WooCommerce up and running on a basic site, and I'm having a problem with the cart.
Basically, when I'm logged in as admin, everything works as expected. But when I'm not logged in, I can add an item to the cart, but the cookies immediately disappear, thereby stopping the cart from working at all... It seems like the session is being reset by either WooCommerce or Wordpress every time a WooCommerce page is visited by a guest.
This is a big problem, as I don't want anyone to be signing up for accounts to buy my single product.
Does anyone know what could be causing this, and how to fix it? I've looked through the WooCommerce code, and I can't see anything but the init method of the $woocommerce global calling the methods that set the cookies... And the cookies themselves are set to be deleted when the browser closes, but they are being overwritten as soon as the cart page loads.
I just ended up installing JigoShop. Needed some CSS tweaks to work with TwentyTwelve, but it allows people to buy stuff, which is more than WooCommerce has done for me ;)
We had the same problem on https://sherpax.cz ecommerce store. Go to plugins, and remove all caching plugins (Comet cache, etc.). There was an issue with session mixing even if Comet cache was set up properly not to cache particular pages (cart, etc.).

Resources