The cart I didn't build
Two ways to put a cart on a static site, and why the cheap one was the expensive one.
The plan for the shop was two phases. Build a simple cart now, build the proper one later if it’s needed. I spent a week on the spec and then deleted phase one.
Phase one was cart permalinks. Shopify will accept a URL containing variant
IDs and quantities and reconstruct that cart on its own checkout. So you can keep
a cart entirely in localStorage, render it yourself, and only hand off at the
end. No API client, no tokens in the browser, no network calls while the customer
shops.
The catch is that everything the cart displays — price, availability, the fact that the item exists at all — comes from the build. The cart is a picture of the catalogue taken at deploy time, and Shopify only finds out what you actually think you’re selling at the handoff.
Phase two was the Storefront API: a real Shopify cart, created and updated from the browser, with live prices and live stock.
For one-of-a-kind paintings, the snapshot version genuinely works. The reason I skipped it is what happens next: prints and cards, which means variants, restocking, and buying more than one of something. Every one of those makes the snapshot wrong in a different way, and each fix is a step towards phase two anyway.
So the choice wasn’t really “simple now or thorough later”. It was “write the cart twice or write it once”. The permalink approach is still the right answer for a shop with a fixed catalogue and a rebuild on every change — it just wasn’t this shop.
Worth noting what phase one bought me even unbuilt: writing the spec is where I found out the snapshot problem existed at all.