WooCommerce is Broken: Fixing Stuck Payments, Empty Carts, and Checkout Bugs

You’ve set up your WooCommerce store. Products are uploaded. Payments are configured. Everything looks fine. Then the first customer tries to check out… and nothing works.

The cart is empty. The payment button does nothing. The order gets stuck on “pending payment” forever. Or worse, customers are charged but the order never registers.

If you run a WooCommerce store long enough, you will encounter these bugs. The good news? Most have known fixes. This article covers the most common checkout failures, why they happen, and exactly how to resolve them, from quick user-level fixes to deep debugging for developers.

Table of Contents

  1. The Empty Cart on Checkout
  2. Stuck “Pending Payment” Orders
  3. Payment Gateway Buttons That Do Nothing
  4. Checkout Page Won’t Load (White Screen / Infinite Spinner)
  5. AJAX Add to Cart Broken
  6. Session and Cart Data Loss
  7. The Block Checkout vs. Shortcode Checkout Debate
  8. Debugging Toolkit for WooCommerce
  9. Prevention: A Stable WooCommerce Setup

1. The Empty Cart on Checkout

Customer adds products to cart. Clicks “Checkout.” The checkout page loads… with an empty cart. The customer leaves. You lose a sale.

Why it happens:
This is almost always a session or caching issue. WooCommerce uses PHP sessions (or sometimes WordPress transients) to store cart data. If something clears or blocks that session between the cart page and checkout, the cart appears empty.

Common causes:

  • Aggressive page caching (especially CDN or hosting-level caching)
  • Caching plugins that cache the checkout page
  • Session conflicts with other plugins or custom code
  • Cross-domain or mixed content issues (HTTP vs HTTPS)

How to fix it:

Step 1: Exclude WooCommerce pages from caching

If using a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache, etc.), exclude:

  • Cart page
  • Checkout page
  • My Account page
  • Shop page (optional but recommended)

Example for WP Rocket: Add these to “Never Cache URLs”:

/checkout/
/cart/
/my-account/

Step 2: Check your hosting-level cache

Many hosts (Kinsta, WP Engine, Cloudways) have their own caching. Whitelist the same WooCommerce pages in your host’s cache settings.

Step 3: Test with caching disabled

Temporarily disable all caching plugins and any CDN. Clear your browser cache. Test again. If it works, re-enable caching one layer at a time.

Step 4: Fix mixed content

If your site loads over HTTPS but some resources over HTTP, the session cookie might not persist. Use a plugin like “Really Simple SSL” or add to wp-config.php:

$_SERVER['HTTPS'] = 'on';

Step 5: Force cart to persist (developer fix)

Add to functions.php as a temporary workaround:

add_action( 'init', 'wc_force_cart_persistence' );
function wc_force_cart_persistence() {
    if ( function_exists( 'WC' ) && is_null( WC()->session ) ) {
        WC()->session = new WC_Session_Handler();
        WC()->session->init();
    }
}

2. Stuck “Pending Payment” Orders

Customer completes payment. Money leaves their account. But in WooCommerce, the order stays on “Pending payment” forever. No confirmation email. No order in your dashboard.

Why it happens:
The payment gateway sent the successful transaction to WooCommerce, but WooCommerce never received or processed the callback (webhook/IPN). Common causes:

  • Payment gateway webhooks blocked by firewall or security plugin
  • Site URL mismatch (site is on http:// but webhook sent to https://)
  • PHP timeout or memory limit exceeded during callback processing
  • Currency or order total mismatch between gateway and WooCommerce

How to fix it:

Step 1: Manually check the payment gateway’s transaction log

Log into Stripe, PayPal, or your gateway’s dashboard. Find the transaction. Does it show “Completed” or “Pending”? If it’s completed on their end but not yours, the webhook failed.

Step 2: Verify webhook URLs

For Stripe: Dashboard → Developers → Webhooks. Ensure the endpoint is https://yoursite.com/wc-api/stripe/ (or similar for your gateway).

For PayPal: IPN URL should be https://yoursite.com/wc-api/paypal/.

Step 3: Check security plugins

Wordfence, Sucuri, and other firewalls sometimes block webhook IPs. Whitelist the gateway’s IP addresses. Temporarily disable the firewall to test.

Step 4: Manually complete the order

If you confirmed payment outside WooCommerce, you can manually mark the order as “Completed” or “Processing” from the WooCommerce → Orders screen. Then email the customer manually.

Step 5: Resend failed webhooks (Stripe)

Stripe allows you to resend failed webhook events from the dashboard. Look for “Failed” events and click “Resend.”

Step 6: Debug logging

Add to wp-config.php to log all WooCommerce errors:

php

define( 'WC_LOG_DIR', WP_CONTENT_DIR . '/wc-logs/' );

Then check wp-content/wc-logs/ for fatal-errors.log or gateway-specific logs.

3. Payment Gateway Buttons That Do Nothing

Customer clicks “Place Order” or the PayPal/Stripe button. The button spins, or nothing happens. No error message. No redirect.

Why it happens:
JavaScript conflict, browser console error, or AJAX failure. Most common: a plugin or theme script is breaking the checkout JavaScript.

How to fix it:

Step 1: Open browser console

Press F12 → Console tab. Look for red errors. Common ones:

  • Uncaught ReferenceError: jQuery is not defined
  • Uncaught TypeError: Cannot read property 'xxx' of undefined
  • Failed to load resource (blocked scripts)

Step 2: Check for JavaScript conflicts

Temporarily switch to a default theme (Storefront, Twenty Twenty-Four). Test checkout. If it works, your theme is the problem.

If still broken, deactivate all plugins except WooCommerce and your payment gateway. Test. Reactivate one by one.

Step 3: Fix common jQuery issues

WooCommerce requires jQuery. If your theme calls jQuery incorrectly, add:

function ensure_jquery_on_checkout() {
    if ( is_checkout() ) {
        wp_enqueue_script( 'jquery' );
    }
}
add_action( 'wp_enqueue_scripts', 'ensure_jquery_on_checkout' );

Step 4: Check for missing payment gateway scripts

Some gateways require additional scripts on the checkout page. Ensure your theme calls wp_head() and wp_footer() in header.php and footer.php.

Step 5: Enable checkout debug mode

In WooCommerce → Settings → Payments → [Your Gateway] → Enable “Debug Mode” (log errors). Then check wp-content/uploads/wc-logs/.

4. Checkout Page Won’t Load (White Screen / Infinite Spinner)

Customer clicks “Checkout” and sees a white screen or a loading spinner that never ends.

Why it happens:
PHP fatal error, memory exhaustion, or infinite loop in a hook. Often caused by a plugin trying to modify checkout fields incorrectly.

How to fix it:

Step 1: Enable WP_DEBUG

Add to wp-config.php:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Then check wp-content/debug.log for fatal errors.

Step 2: Increase memory limit

Add to wp-config.php:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Step 3: Check for infinite redirects

Sometimes a plugin or custom code creates a loop between cart and checkout. Check your .htaccess file for odd rewrite rules. Temporarily rename .htaccess to .htaccess_old and test.

Step 4: Validate checkout field overrides

If you have custom code modifying checkout fields, comment it out temporarily. Look for functions hooked to woocommerce_checkout_fields.

5. AJAX Add to Cart Broken

Customer clicks “Add to Cart” on a product page. The button spins, but the cart counter doesn’t update. The page reloads. Or nothing happens.

Why it happens:
AJAX conflict, missing wc-ajax endpoint, or caching.

How to fix it:

Step 1: Verify AJAX URL

View page source. Search for wc_ajax_url. It should point to /?wc-ajax=%%endpoint%%. If it’s wrong, check your permalinks (Settings → Permalinks → Save Changes. No edits needed, just resave).

Step 2: Exclude AJAX endpoints from cache

Add wc-ajax to your caching plugin’s “Never Cache” list.

Step 3: Check for corrupted .htaccess

Resave permalinks (Settings → Permalinks → Save Changes). This regenerates .htaccess rules.

Step 4: Manual add to cart test

Visit https://yoursite.com/?add-to-cart=123 (replace 123 with a real product ID). If that works but AJAX doesn’t, the problem is JavaScript.

6. Session and Cart Data Loss

Customer logs in, adds items to cart, logs out, logs back in: cart is empty. Or cart empties randomly between page loads.

Why it happens:
Session handler issues, database table corruption, or cookie problems.

How to fix it:

Step 1: Repair WooCommerce session tables

In phpMyAdmin or similar, run:

sql

REPAIR TABLE wp_woocommerce_sessions;
OPTIMIZE TABLE wp_woocommerce_sessions;

Step 2: Clear all sessions (caution: logs out all customers)

From WP CLI:

bash

wp wc tool run clear_sessions

Or use a plugin like “WooCommerce Database Cleanup.”

Step 3: Check cookie settings

In WooCommerce → Settings → Advanced → Page setup, ensure Cart and Checkout pages are correctly assigned.

Step 4: Force session handling

Add to functions.php:

php

add_action( 'init', 'wc_force_session_start' );
function wc_force_session_start() {
    if ( function_exists( 'WC' ) && ! WC()->session->has_session() ) {
        WC()->session->set_customer_session_cookie( true );
    }
}

7. The Block Checkout vs. Shortcode Checkout Debate

WooCommerce now offers two checkout experiences:

  • Block Checkout (default, uses the Block Editor)
  • Shortcode Checkout (classic [woocommerce_checkout])

Which one breaks less?
Currently, the shortcode checkout is more stable, but the block checkout is catching up.

If block checkout is broken:

Option 1: Roll back to shortcode checkout

  1. Create a new page, add shortcode [woocommerce_checkout]
  2. In WooCommerce → Settings → Advanced → Page setup, set “Checkout” to that new page
  3. Clear cache

Option 2: Fix block checkout issues

  • Ensure your theme supports the block checkout (requires woocommerce/checkout block)
  • Update WooCommerce and all extensions
  • Check for custom CSS breaking the block layout

Known block checkout bugs (as of 2026):

  • Custom field hooks don’t always work
  • Some payment gateways fail to load
  • Address autocomplete conflicts

Recommendation: Use shortcode checkout for production stores until the block checkout matures.

8. Debugging Toolkit for WooCommerce

When a checkout bug appears, use these tools before calling for help:

ToolWhat it does
WooCommerce Status ReportWooCommerce → Status → System Status. Copy and paste into support requests.
WP_DEBUG_LOGCaptures PHP errors. Essential for white screens.
Browser Console (F12)Shows JavaScript errors breaking checkout.
Health Check & TroubleshootingPlugin that lets you disable plugins/theme only for your session.
WooCommerce LogsWooCommerce → Status → Logs. Look for fatal-errorsstripepaypal, etc.
Staging siteClone your live site to test fixes without downtime.

Quick debug workflow:

  1. Enable WP_DEBUG_LOG
  2. Replicate the issue
  3. Check debug.log and WooCommerce logs
  4. Check browser console
  5. Disable all plugins except WooCommerce + gateway
  6. Switch to Storefront theme
  7. If fixed, re-enable one by one
  8. Never test on live during peak hours

9. Prevention: A Stable WooCommerce Setup

Most checkout bugs are preventable. Follow these rules:

Rule 1: Never cache cart, checkout, or my account pages
Use your caching plugin’s exclusion settings religiously.

Rule 2: Keep everything updated
WooCommerce core, payment gateway plugins, WordPress, and your theme. Old code = old bugs.

Rule 3: Test payment gateways regularly
Run a $1 test transaction once a week. You’ll catch webhook failures early.

Rule 4: Use a staging site
Never update WooCommerce or change checkout logic on your live site first.

Rule 5: Limit checkout customization
Every custom field or JavaScript snippet is a potential break point. Use hooks, not core file edits.

Rule 6: Monitor failed webhooks
Stripe and PayPal dashboards show failed webhook attempts. Check them weekly.

Rule 7: Choose reliable hosting
Cheap hosting with aggressive caching and low PHP limits will break WooCommerce. Use managed WordPress hosting if possible.

Final Thoughts

WooCommerce checkout bugs are frustrating, for you and for customers who just want to give you money. But almost every bug has a known fix. The key is systematic debugging: check caching first, then JavaScript conflicts, then webhooks, then database issues.

When a customer reports a checkout bug, ask them:

  • What exactly happened? (Button did nothing? Error message? White screen?)
  • What browser and device?
  • Does it happen every time or sometimes?

And remember: Before touching anything on a live store, take a backup. Clone to staging if possible. And always test after every change.

Your checkout is your revenue pipeline. Keep it clean, keep it tested, and keep it monitored.

Was this post helpful?
Buy us a coffee!