Cart and checkout cache issue

Topic summary

Issue: Cart attributes updated on the cart page do not consistently sync to checkout. If a user visits checkout, returns to cart, changes an attribute (e.g., isDeliveredSaturday from Yes to No), then completes checkout, the order retains the old value (Yes), creating mismatch and confusion.

Context and symptoms:

  • Occurs after an initial successful update; subsequent updates revert to old attributes.
  • Checkout and related apps (e.g., Shipfy) appear to receive stale cart data.
  • Behavior improves temporarily after clearing browser cache/local storage, suggesting a caching/local storage cause.

Suggestions shared:

  • If using an app to manage attributes, contact the app’s support.
  • For custom code, ensure attributes update on change events.

Workaround/Resolution reported:

  • Deleting a localStorage key created by checkout fixes the issue when returning from checkout to cart.
  • Implementation: add before any attribute update code on the cart template: localStorage.removeItem(“__ui”).
  • Result: The correct, most recent cart state loads and attributes sync properly to checkout.

Status: A practical client-side workaround is provided and confirmed by one participant; original poster’s resolution not confirmed. Root cause likely cache/local storage interaction rather than metafields themselves.

Summarized with AI on January 23. AI used: gpt-5.

Hi @Ecommerce5 ,

I was able to solve this in my situation by deleting a local storage item with the name “__ui” that was being created on the checkout page. I put this line of code in the script tag in the cart template before any code that makes updates to cart attributes.

localStorage.removeItem("__ui")

Now when users navigate back to cart from the checkout, the right version of the cart gets loaded.

2 Likes