Mangcoding

icon chat
Mulida Asti - Thursday, 6 March 2025 - 4 months ago

Fixing the Empty Cart Issue in WooCommerce

single image
Photo by Karolina Grabowska On Pexels

For various reasons, sometimes you add a product to the cart, but the cart page still appears empty (even though you can clearly see the cart widget containing products, for example).

But don’t worry! This is often just a simple caching issue. In this article, Mangcoding will discuss How to Fix the Empty Cart Issue in WooCommerce.

The WooCommerce cart page is quite complex. It displays dynamic content based on cookies and PHP sessions, using PHP, JS, and Ajax. This page must be excluded from caching and can experience issues if outdated software is in use.

So, here are some solutions to the “Empty Cart” problem that you can follow without any technical knowledge.

Link Mangcoding

1. Update WordPress & WooCommerce

This might not even count as a fix because we assume your website is already running the latest WordPress and WooCommerce versions.

If not, there’s no point troubleshooting further because once you report the issue to plugin, theme, or hosting support, they’ll likely ask you to update WordPress and WooCommerce first.

Link Mangcoding

2. Reflect on What Changed Before the Error Occurred

Maybe you installed a new plugin? Or updated your theme? Or made custom WooCommerce modifications? Perhaps WordPress auto-updated.

If you keep a changelog of updates on your WooCommerce site and compare it to when the Empty Cart issue started, you might quickly identify the cause without needing further steps.

Simply uninstall the recently added plugin or roll back your theme version.

If not, proceed with the next steps.

Link Mangcoding

3. Temporarily Disable All Plugins Except WooCommerce

This is a common troubleshooting method. You won’t lose any plugin data or settings, and you can re-enable everything within seconds.

Disable all plugins and check if the cart works again.

If the WooCommerce cart now fills with products, one of the plugins was causing the Empty Cart problem.

Re-enable your plugins one by one and test the cart each time. The moment the cart empties again, the plugin you just activated is the culprit.

Deactivate that plugin, check for updates, and if the issue persists, report the bug to the plugin developer. If there’s no fix, look for an alternative plugin.

Link Mangcoding

4. Temporarily Switch to the Twenty Twenty Theme

This checks whether the issue is theme-related. Switching themes won’t cause you to lose any settings. Your widgets, menus, and customizer settings will return when you reactivate your current theme.

First, if you’re using a child theme, switch to the parent theme and test the Add to Cart and Cart features.

If that doesn’t work, switch to Twenty Twenty, Storefront, or any default WordPress theme from the popular tab.

If the problem disappears, check whether you missed any theme updates and report the bug to the theme developer.

If switching themes doesn’t solve the problem, there are more steps to try.

Link Mangcoding

5. Make Sure Theme, WooCommerce & WordPress Versions Are Compatible

When updating plugins, you’ll see a note stating whether the plugin is compatible with your current WordPress version.

There’s no point updating WooCommerce or related plugins if they haven’t been tested with your site’s current version.

The same applies to theme updates. Theme developers may need time to adjust to WooCommerce changes. So ensure that WordPress, WooCommerce, extensions, and your theme are all in sync.

Mangcoding Masalah Keranjang Kosong WooCommerce 1

Link Mangcoding

6. Check for Red Warnings Under WooCommerce > Status

On the System Status page, ensure all WooCommerce pages are properly set up, the cart page has the correct shortcode, and no outdated template files are present.

Mangcoding Masalah Keranjang Kosong WooCommerce 2

Link Mangcoding

7. Try Clicking the Button Under WooCommerce > Status > Tools

Using the “Clear customer sessions” tool can often help fix empty cart

problems (and shipping calculation issues).

Woocommerce Tools Status

Link Mangcoding

8. Save Your Permalinks

Go to WordPress > Settings > Permalinks and click Save Changes without modifying anything. This refreshes the permalinks and could fix the cart issue.

Link Mangcoding

9. Check for Spaces in Your Checkout Endpoints

Mangcoding Masalah Keranjang Kosong WooCommerce 3

Go to WooCommerce > Settings > Advanced > Checkout Endpoints and ensure there are no spaces in the endpoint URLs. This has caused empty cart issues in some cases.

Link Mangcoding

10. Properly Clear Your Cache (Plugin or Server-Side)

The cart, checkout, and account pages should never be cached as they display dynamic content.

If your caching plugin is storing these pages, your cart may appear empty. Use a WooCommerce-compatible caching plugin that allows you to exclude specific URLs.

Also, consider that server-side caching might be active. Contact your hosting provider to disable or properly configure server caching, ensuring the cart, checkout, and account URLs are excluded.

Beberapa hosts rely on their own caching system, such as Varnish, and this is sometimes applied to your website by default. Create a ticket or contact them to find out if they have something like that and if they can disable it as soon as possible.

For example, WPEngine uses its own caching system, which can affect WooCommerce carts. Contact support to set up cache exclusions for WooCommerce pages and/or Ajax requests.

Please try applying these steps as explained in this article. Hopefully, this guide is helpful and provides a solution for you, especially in resolving the Empty Cart Issue in WooCommerce.

Reference: How to Fix the Empty Cart Issue in WooCommerce

Link Copied to Clipboard