BigCommerce Troubleshooting

The cart empties when the customer opens checkout

If the cart empties at checkout, keep cart and checkout on one primary hostname, regenerate single-use redirect URLs for headless carts, and isolate checkout scripts.

Last updated · Checkout, shipping and payments · Applies to: Stencil, headless and Catalyst storefronts; single and multi-storefront stores

Symptoms

  • The cart page shows the right items, but when the shopper clicks to check out, checkout opens with an empty cart or sends them straight back to an empty cart page.
  • It happens on one channel while another channel on the same store works.
  • It shows up more in some browsers than others, often Safari or browsers that restrict cross-domain cookies.
  • On a headless or Catalyst storefront, the shopper lands on a 404 at /session-sync, or checkout does not load at all.
  • On a store with a custom checkout or an offsite payment step, the shopper comes back from that step to an empty cart page.

Cause

Checkout can only show a cart it can find. It finds the cart through the shopper's session, and the session usually lives in a cookie tied to one hostname. In practice, the cart empties for one of these reasons, most common first:

  1. The hostname changes between cart and checkout. The shopper browses on one host (for example the bare domain, a redirect domain, or a mybigcommerce.com address) and checkout opens on another. The session cookie does not follow them. BigCommerce's checkout domains guide explains that a channel without its own checkout URL uses the default channel's domain, usually a mybigcommerce.com hostname, and browsers that restrict cross-domain cookies may not carry the session and cart across.
  2. A headless storefront hands off the cart incorrectly. Cart redirect URLs are single use. A reused link, a domain added as a redirect domain instead of the channel's primary URL, or a missing channel_id in a Customer Login JWT can each break the handoff.
  3. A customization interrupts the flow. A script, a custom checkout, or the return from an offsite payment step can send the shopper to the cart page instead of completing checkout.

Resolution

Work through these in order; the early steps change nothing on the live store.

  1. Reproduce in a clean session. Open a private window, add an item, and go to checkout with your browser's developer tools open on the Network tab. Note the cart hostname, the checkout hostname, every redirect in between, and the time.
  2. Compare with a working path. Repeat in a second browser and on a channel that works. If only one browser fails, cookie restrictions on a hostname switch are the likely cause.
  3. Make the hostnames match. Pick one primary storefront URL (www or the bare domain) and redirect every other variant to it before the shopper adds to cart. The checkout must share a main domain with the storefront: checkout.example.com works for www.example.com, but checkout.example.org does not. BigCommerce rejects a checkout URL that breaks this rule. Check that the certificate covers the hostnames you use; see the custom domain shows an HTTPS warning.
  4. Recheck after any domain or site URL change. On channels with a custom checkout URL, BigCommerce removes that checkout URL when the channel's site URL changes, so checkout falls back to the shared domain until you set a new one. If you recently moved domains, also see the store stops resolving after a custom domain change.
  5. For headless storefronts, check the handoff.
    • Generate a fresh redirect URL at the moment the shopper clicks checkout. The Create Cart Redirect URL endpoint (POST /stores/{store_hash}/v3/carts/{cartId}/redirect_urls) returns a link that is valid for 30 days but "may only be used once"; after the first visit it is invalidated. Do not cache or email it.
    • On Catalyst, a 404 at /session-sync usually means the domain was added as an additional or redirect domain rather than the channel's primary storefront URL, or was added to a different channel from the one BIGCOMMERCE_CHANNEL_ID names. Per the session sync guide, go to Channel Manager > your channel > Domains, set the custom domain as the primary storefront URL, confirm no other active channel claims it, and allow 10 to 15 minutes before retesting.
    • If you log customers in with a Customer Login JWT, include channel_id. The headless carts guide states that if you omit it, CORS checks fail and checkout will not load.
  6. Isolate customizations. In a test environment or preview, disable checkout and cart scripts in Script Manager, tag manager rules, and any custom checkout, then retest. Re-enable them one at a time. If a script itself is not loading, see a script added in Script Manager does not load.
  7. Check payment redirects. If the cart empties only after a 3D Secure or offsite payment step, test the same gateway on BigCommerce's Optimized One-Page Checkout. If that works, the custom checkout's return handling is the problem. Also check for an incomplete order; see card payment fails and the order remains incomplete.
  8. Verify the fix. In a private window on each affected browser and channel, add an item, open checkout, confirm the cart contents and totals carry over, and place a test order.

If it still fails, send BigCommerce support the store and channel, the cart and checkout URLs, the timestamp, the browser, and a HAR file of the failed attempt.

How to prevent it

  • Keep one primary hostname per channel and redirect every other variant to it.
  • After any domain, site URL or certificate change, run a full add-to-cart and checkout test on every channel.
  • Test checkout in Safari and one privacy-focused browser, not only Chrome.

B2B and ERP angle

On multi-storefront stores each channel has its own primary and checkout URL, so a domain change can break just one channel. Connectors, quote tools and punchout or reorder flows that build carts through the API must request a new redirect URL each time a buyer opens checkout. A link stored in an ERP record or quote email works once, then fails. For related handoff issues, see embedded checkout omits the shipping address for an API-created cart.

More in the BigCommerce knowledge base, including every article on Checkout, shipping and payments.