Shop: Fourthwall import, sizes and colors, and a cart #31

Merged
jcoffey-dev merged 3 commits from shop/fourthwall into main 2026-10-17 00:13:31 +00:00
Owner
  • hotdog-cms import fourthwall brings a Fourthwall shop's products in as shop pack pages, photos and all. Run it again whenever the shop changes; unchanged pages and photos are left alone.
  • The shop pack (1.2.0) has sizes and colors: a picker whose Buy now goes straight to the checkout, no script needed.
  • cart: true turns on a cart kept in the visitor's browser: Add to cart beside Buy now, a cart page with suggestions, one checkout for everything.
  • Transparent WebP photos stay WebP (the store's photos went from 152 MB to 24 MB), and templates get picture and pictureAt.

Tried against the real shop: import, picker, cart and a multi-item checkout all work.

- `hotdog-cms import fourthwall` brings a Fourthwall shop's products in as shop pack pages, photos and all. Run it again whenever the shop changes; unchanged pages and photos are left alone. - The shop pack (1.2.0) has sizes and colors: a picker whose Buy now goes straight to the checkout, no script needed. - `cart: true` turns on a cart kept in the visitor's browser: Add to cart beside Buy now, a cart page with suggestions, one checkout for everything. - Transparent WebP photos stay WebP (the store's photos went from 152 MB to 24 MB), and templates get `picture` and `pictureAt`. Tried against the real shop: import, picker, cart and a multi-item checkout all work.
jcoffey-dev added 2 commits 2026-10-16 22:49:32 +00:00
A WebP with transparency (a product photographed on nothing, as print
shops supply them) was turned into a lossless PNG, often ten times the
size and slow to make. It now stays WebP, lossy with its transparency,
at each size; an opaque WebP still becomes JPEG. The media index takes a
picture whose only file is a WebP.

Templates get what Markdown pictures had: picture "/media/x.webp" "alt"
"sizes" "class=x loading=lazy" writes the <img> with its width, height
and every published size, and pictureAt "/media/x.webp" 160 is the
address of the smallest size at least that wide.
Shop: Fourthwall import, sizes and colors, and a cart
ci / editor-ui (pull_request) Successful in 1m19s
ci / go (pull_request) Successful in 1m30s
0a2e0f33f6
hotdog-cms import fourthwall brings a Fourthwall shop's public products
in as shop pack pages, with the storefront token from
HOTDOG_FOURTHWALL_TOKEN: description and details as Markdown, photos
brought into the site, sizes and colors as variants, collections as
terms of a taxonomy. It's run again whenever the shop changes: products
are matched by id, unchanged pages and photos are left alone, front
matter the site added is kept, and products that left the shop are
listed (deleted with -prune).

The shop pack (1.2.0) takes variants: each with a price and a buy link,
or, when the product has a checkout form (Fourthwall's reads the choice
from its address), a size picker whose Buy now goes straight to the
checkout. Both work without a script. Prices that vary show "From", and
search engines get an AggregateOffer.

cart: true in site.yaml turns on a cart: HotDog's cart script, kept in
the visitor's browser and sent nowhere until checkout, which opens the
shop's checkout with every item (id:quantity, joined). Product pages get
Add to cart beside Buy now; the cart page (layout: cart) lists, changes
and removes items and suggests other products, those sharing a tag
first. Themes put {{ cart }} in the head and {{ cartLink }} in the
header, as the starter now does, and the privacy notice says where the
cart is kept.
jcoffey-dev added 1 commit 2026-10-16 22:57:19 +00:00
Fourthwall test: a plain example product
ci / editor-ui (pull_request) Successful in 1m18s
ci / go (pull_request) Successful in 1m21s
4935aa0fbc
jcoffey-dev merged commit 912569a37e into main 2026-10-17 00:13:31 +00:00
jcoffey-dev deleted branch shop/fourthwall 2026-10-17 00:13:31 +00:00
Sign in to join this conversation.