Skip to content

Add Fourthwall merch store with on-site cart - #20

Merged
patrickrb merged 2 commits into
mainfrom
add/fourthwall-store
Aug 15, 2026
Merged

patrickrb merged 2 commits into
mainfrom
add/fourthwall-store

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

Summary

New /store page selling FT8AF merch through the Fourthwall shop, with an on-site cart — shoppers pick a size/color, build a cart on the page, and check out on Fourthwall's hosted checkout.

  • Static-first, live prices: the build renders the hero, skeleton grid, cart panel, and all localized strings per locale; store.js then fetches products from the Fourthwall Storefront API client-side, so prices/availability never go stale between deploys.
  • Cart: per-product variant dropdown (out-of-stock options disabled), per-variant price with compare-at strikethrough, quantity −/+ controls, locale-formatted totals via Intl.NumberFormat, persisted in localStorage.
  • Checkout: creates a Fourthwall cart via POST /v1/carts directly from the browser (the Storefront API is CORS-enabled and the token is public/read-only by design — it can only list products and create carts), then redirects to the Fourthwall-hosted checkout. Payment and shipping never touch this site.
  • Token via env: FOURTHWALL_STOREFRONT_TOKEN is read at build time (.env.example documents it). Without it the site still builds — /store renders a translated fallback linking to the shop — so CI needs no secret.
  • Safety: product data is rendered via DOM APIs (textContent), never innerHTML; pagination is followed defensively (bounded, stops if the page param is ignored); API failure shows a translated error with a direct link to the shop; <noscript> fallback links to the shop.
  • Store link added to nav, mobile menu, and footer; store_add_to_cart / store_checkout / link-click analytics events wired into the existing Vercel Analytics tracking.
  • All new strings translated in the 16 locale catalogs (not English fallbacks); check-i18n passes with the store keys at 100% coverage in every locale.

⚠️ Before this deploys

Add FOURTHWALL_STOREFRONT_TOKEN to the Vercel project env (Production + Preview) so deployed builds bake the token in. Without it, /store shows the link-to-shop fallback instead of the product grid.

Verification

  • node build.mjs builds all 160 pages with and without the token (warns when missing); check-i18n passes (structural).
  • Scripted end-to-end run against the live API: rendered 4 products with variants, added a shirt twice → one cart line at qty 2 / $47.50, bumped qty → $71.25, clicked checkout → real Fourthwall cart created and the redirect URL returns HTTP 200 on the shop's checkout page.
  • Manually tested via dev-server.py across locales (en/es/ja/ar incl. RTL).

Test plan

  • Open /store, confirm products load with prices
  • Pick a variant, add to cart, adjust quantities
  • Check out → lands on Fourthwall checkout with the items pre-filled
  • Spot-check a localized page (e.g. /ja/store) for translated UI and prices

🤖 Generated with Claude Code

New /store page selling FT8AF merch through the Fourthwall shop
(burnsoft-development-shop.fourthwall.com). The static build renders the
hero, skeleton grid, cart panel, and all localized strings; store.js then
fetches live products from the Fourthwall Storefront API client-side so
prices and availability never go stale between deploys.

Shoppers pick a variant (out-of-stock options disabled), build a cart
on-page (persisted in localStorage), and check out via a Fourthwall cart
created directly from the browser — the Storefront API is CORS-enabled
and the token is public/read-only by design, so no server proxy is
needed. Payment and shipping stay entirely on Fourthwall's hosted
checkout. Cards show per-variant prices with compare-at strikethrough.

The storefront token comes from FOURTHWALL_STOREFRONT_TOKEN at build time
(see .env.example); without it the site still builds and /store renders a
plain link to the Fourthwall shop, so CI needs no secret.

Store nav/footer links added on every page, store_* analytics events
wired into the existing Vercel Analytics click tracking, and all new
strings translated across the 16 locale catalogs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ft8af-site Ready Ready Preview Aug 15, 2026 6:30pm

Request Review

Product links and the checkout redirect now use the shop domain from
NEXT_PUBLIC_FW_CHECKOUT (e.g. shop.ft8af.app, the Fourthwall custom
domain) instead of the *.fourthwall.com default. Scheme optional; bare
hostnames get https://. Falls back to the fourthwall.com shop URL when
unset, so builds without the var still work.

Also ignore .vercel/.env* from `vercel link`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@patrickrb
patrickrb merged commit 603e04f into main Aug 15, 2026
4 checks passed
@patrickrb
patrickrb deleted the add/fourthwall-store branch August 15, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant