BlogTroubleshootingStorage

The Vendra cart or wishlist is empty after a reload (or the order page is blank)

Where the cart, wishlist, compare list, settings and the demo order are stored, why they can come back empty, and what is expected behaviour rather than a fault.

2 min readPerforks

Where the cart, wishlist and compare list live: localStorage keys, kept per origin

Vendra keeps the shop state in the browser. Knowing exactly where tells you why it is sometimes gone.

Where the state lives

WhatStorageKey
Cart lines (product, colour, size, quantity)localStoragevendra-cart
Wishlist, compare list (product ids)localStoragevendra-wishlist, vendra-compare
Settings panel choiceslocalStoragevendra-settings
Cookie notice dismissedlocalStoragevendra-cookie
Promo code entered at checkoutsessionStoragevendra-promo
The demo order placed at checkoutsessionStoragevendra-order

localStorage survives a reload and a closed browser; sessionStorage lasts for one tab. Both belong to one origin (scheme, host and port), and to one browser profile.

The cart is empty after a reload

  1. The origin changed. A cart added on http://localhost:5173 is not visible on http://127.0.0.1:5173, on the npm run preview port, or on your live domain; each is its own storage. Pages opened from disk (file://) are the least predictable: some browsers give every file its own storage or none at all. Use one address, ideally a local web server.
  2. A private window, or site data blocked. Writes fail silently (the engine wraps them in try/catch), so the cart works on the page and is gone on the next load. Try a normal window.
  3. You just placed the demo order. That is by design: placing the order clears the cart, drops the promo code and opens order-complete.html.
  4. The settings reset. The panel's reset button removes vendra-settings only; it does not touch the cart.

The order confirmation page is blank

order-complete.html reads vendra-order from sessionStorage, which the checkout wrote in the same tab. Opening the page directly, in a new tab, or after closing the browser finds nothing to show. Go through the checkout in one tab and it fills in.

The wishlist shows fewer products than I added, or compare refuses a fifth

Compare keeps at most four products; adding a fifth drops the oldest. The wishlist has no limit. Both lists store ids, and the pages look each id up in the catalogue of the page: a product removed from catalog.js disappears from the lists on the next build.

The React edition and the HTML edition do not share a cart

Expected when they are on different origins, as on the live demo, where the React edition is under /react/ of the same host and therefore does share it. Same origin, same keys, same cart.

Checking the storage

In the browser's developer tools, open Application (Chrome, Edge) or Storage (Firefox), then Local Storage for your origin, and look for the keys above. From the console, Vendra.cart.items() prints the lines the engine sees and Vendra.cart.clear() empties them.

None of this is meant for production. When the shop goes live, src/js/store.js is replaced by calls to your backend, and the cart follows the customer's account instead of the browser.