Woocommerce - Cart Empty for Non Logged In Users - wordpress

I have a problem in my Woocommerce shop. Not logged-in users can't add products in their cart! When they press the "add-to-cart-button", the products is added to the cart. But if they refresh the page or go to the cart, it is empty!
If I am logged-in, it is not happening and everything is working good.
Can someone please help?

I think the problem is in your server configuration. If you use any caching plugin deactivate it and hard refresh your browser. Then check again if it works or not?
Here is an article Mike Jolley wrote: http://mikejolley.com/2013/12/20/problems-with-cart-sessions-and-woocommerce/

I had this problem. For me, I realised it was because the session_id column in the wp_woocommerce_sessions table was not auto incrementing. After I modified the table, it worked.

In case anybody else runs into this: hosting providers like WP Engine make extensive use of caching to improve the performance of your webshop. Although, they're excluding pages where this is not desired, like the cart or checkout page.
They do this for the default paths (/cart, /checkout) only, though. So if you change the default path to adapt the URLs to your language of choice, for example, make sure to write to their support so they can add exceptions for your pages.
See here for a description of this issue from WP Engine.

It sounds like the website is behaving differently for logged in users vs. visitors – this won’t be affected by the “checkout without registering” option. This kind of problem is usually caused by either a conflict with your theme, Plugin or with Cache.
The best way to determine if the issue is being caused by a theme and/or plugin is to temporarily switch your theme to Storefront and disable all plugins except for WooCommerce. A good way to do this is with a free plugin called Meks Quick Plugin Disabler ( https://wordpress.org/plugins/meks-quick-plugin-disabler/ ), which will remember what plugins you currently have active so it’s easy to switch back.
If that resolves the issue, then slowly re-enable features until you find the one that’s causing the conflict.
Please follow this link for Cache full detail: https://businessbloomer.com/woocommerce-solving-cart-empty-issue/

For me the issue was using "cart-2". WP-Engine does not cache "cart" but does for other pages. I changed the URL and it started working.

Related

Images showing in description of woocommerce products instead of normal thumbnail location

Instead of images showing up as thumbnails underneath the main product image, they are getting added to the description section of each product. Here is an example product page: https://vdgmilitaria.com/shop/other-axies-allies/italy/ww2-italian-german-african-campaign-medal/
Any idea what could be causing this?
As a side note it seems like some of the styles on the website are now broken too and things are sitting in weird places such as the screenshot attached.
I've tried inspecting the product pages on my website with the web developer tools, but still can't figure out what is going on here.
This issue is likely caused by changes made to the WooCommerce theme or plugins affecting the product page layout and functionality. To fix it, you can try the following steps:
Disable all plugins temporarily and see if the issue is resolved. If so, re-enable each plugin one by one and check if the issue reappears after each activation.
If disabling plugins doesn't resolve the issue, try switching to a default WordPress theme like Twenty Twenty-One to see if the problem is with the theme.
If the issue still persists, you can try contacting the WooCommerce support team or the theme author for further assistance.
If all else fails, consider hiring a WordPress developer to investigate the issue and make necessary fixes.
Note: Before making any changes, it's always a good idea to backup your website to avoid losing any data.

how to solve this "Please choose product options by visiting" variant product woocommerce error?

how to solve this "Please choose product options by visiting" variant product woocommerce error?
I had this problem today. But while reading through a similar issue on WordPress Support, I discovered that it's related to a plugin that blocks rendering of the product page until its JS or CSS files are loaded. In my case it was
Yoast SEO: WooCommerce
To fix, you need to identify the plugin and disable it:
Disable all your plugins except WooCommerce and maybe your page
builder.
Check if the issue persist - usually it will go away.
Start enabling your most essential plugins one at a time.
Check for the problem every time you enable one of your plugins.
Once you have found your vilain, you can try to remove any Defer Render-blocking JavaScript or contact the plugin developer for solution if you must use the plugin.
Since Yoast SEO: WooCommerce was not critical to my store, I simply disabled it and I've been happy :)

Blank/empty pages Cart and Checkout

We’re just getting started with WooCommerce and are preparing a store with just a few categories and products in it to play around with it and get to know it before we get seriously into it.
We don’t yet have an SSL certificate for our website.
Does this mean that we won’t be able to create a store and test it until we get an SSL certificate?
As is, we’re seeing blank pages when we go to cart and try to go to checkout. On those pages, our header is there, but the page below the header is empty, blank.
I posted this same question in an existing thread that mentioned this, but haven’t had a reply. Thought maybe it might be missed in that other thread.
maybe, can you see do code shablon this page?
Thank you.
I came across this issue while writing a custom WooCommerce theme from scratch. I realized that if your theme has a page.php template (or any of the fall-back templates in the WP hierarchy) - you need to make sure, that the_content(); function gets called in the template that your page post-type is going to use (either page.php, singular.php or index.php) - if you are using the standard WooCommerce setup.
If not, the WooCommerce short-codes are simply never output - which the cart, checkout, my-account and order-tracking pages depend on.
Make sure to enter the [woocommerce_cart] shortcode in the Cart page and [woocommerce_checkout] shortcode on the checkout page.
And Goto Woocommerce settings and set the Cart Page, Checkout page.
This should solve the issue.
Meanwhile, check the Woocommerce -> System Status and look for errors.
If you are using any page builder, make sure you enter the Shortcodes in the text box modules.
If you still face the issue, try reverting back to Gutenburg editor or classic editor instead of Page builder.
How to debug:
wordpress.org/support/topic/how-to-debug-issues-after-updates
Perhaps it would be easier to find what is causing the conflict. Try temporarily switching back to the WordPress Twenty Sixteen Theme, or Storefront, and disable all plugins except for WooCommerce. If that resolves the issue, then slowly re-enable features until you find the one that’s causing the conflict

Removing /product-category/ and /shop/ from URL in WooCommerce

I'm building an ecommerce store with WooCommerce, and I would like to change how my URLs are created. At the moment the structure is
domain.com/product-category/category-name
domain.com/shop/category-name/product-name
For SEO purposes would like to change it to
domain.com/category-name
domain.com/category-name/product-name
but when I delete the product category base in Wordpress permalink settings, it just reappears. Then I found this page stating that I shouldn't change it at all. Is that true? Am I wrong in wanting to alter the URLs?
If it's fine to change them, how can I do it?
I think this is helps you.
Removing those URL is definitely one of the major improvements in search engine optimization for any online store because then search engines will not take into account the unnecessary words in the link. So, the search for your products will become more precise. I also encountered this problem and tested most of the plugins that were available on the WordPress website. Now I definitely can recommend Permalink Manager by Premmerce because it's free, very user friendly and simple plugin.
You can download it in WordPress site here: https://wordpress.org/plugins/woo-permalink-manager/
Thanks.

How to remove Yoast from blog posts page

I am running into an error were Yoast keeps pulling blog posts that are for members only and causing login screen to pop up. When I disable Yoast across the whole website it works. But i need to be able to keep keep the plugin without running into errors like this.
Log in to your WordPress website. When you're logged in, you will be in your 'Dashboard'. On the left-hand side, you will see a menu. In that menu, click on 'SEO'.
Hope this help.
There is no any option for custom apply plugin in yoast. If you find any error then change plugin and use All in One SEO Plugin. This is best.
Yoast SEO is a WordPress plug-in designed to help you improve some of the most important on-page SEO factors–even if you aren’t experienced with Web development and SEO. This plug-in takes care of everything from setting up your meta titles and descriptions to creating a sitemap. Yoast even helps you tackle the more complex tasks like editing your robots.txt and .htaccess.
Some of the settings may seem a little complex if you’re new to SEO and WordPress, but Yoast created a complete tutorial to help you get everything set up. And the team at WPBeginner made this handy video to help you get set up quickly.

Resources