How to Prevent Cart from clearing on registration in Woocommerce? - wordpress

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 🙂

Related

WP Plugin idea/search: Selectively activate certain plugins on certain wp-admin pages

We use a lot of plugins and unfortunately can't remove more of them.
Our backend is slow.
Wordpress is built to load each plugin on every page load, also in the wp-admin backend. So even if you are on pages, where no plugin would be needed, woocommerce, contact form 7 etc. will be loaded. They put their CSS in the page but also do PHP stuff and slow everything down.
We know plugin organizer - a plugin that makes it possible to selectively load certain plugins on certain pages. They have a feature to do it on the backend - but it's a already a hell to work with it on the frontend. We use plugin logic in the frontend now.
Is there already a plugin or a hand crafted solution to select which plugins should be deactivated/activated on with wp-admin pages?
I guess it's needed to load every plugin on every wp-admin page to get the admin menu (the left side menu) - so I might be needed to built this menu and cache it somehow.
And then selectively activate plugins for certain pages.
We use custom fields - so ACF plugin has to be activated on some pages - also on some woocommercer pages. Polylang (for multilang) must be activated on a lot of pages.
But for example woocommerce doesn't need to be loaded on the event calendar pages and vis versa.
Do you know of existing solutions to lower the time needed to build the backend.
Are there any caching options?
You cannot activate/deactivate plugins individually for particular pages. Each plugin is either active or not when your site loads.
Here's something to try: In your staging environment, deactivate all of the plugins to see if that solves your problem with the slow admin menu. If it does, reactivate each plugin one by one until you find the problematic plugin. Then troubleshoot from there to determine the root of the issue.
You could also check your server's error logs to see if there are any warnings indicating issues with the site.
If that doesn't help, one final piece of advice I would offer is to contact your hosting company directly to inquire about any potential server issues that are slowing down your site's performance.

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 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?
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/

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