Skip to content

feat: public cart — /cart + add/update actions (ADR 0026) - #1

Merged
DanMat merged 1 commit into
mainfrom
feat/cart
Aug 31, 2026
Merged

DanMat merged 1 commit into
mainfrom
feat/cart

Conversation

@DanMat

@DanMat DanMat commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

PR③ of Commerce checkout (Foodmart Slice 4). The storefront's public cart: a themed private /cart section + /ext/shop/cart/{add,update} POST actions driving Commerce's CartPort, plus add-to-cart buttons.

Cart = opaque server-random cookie (HttpOnly+SameSite=Lax+Secure); viewing mints nothing; a real cart's mutation requires its per-cart CSRF token; server-side price. See ADR 0026. PHPStan max · 12 tests · cs-fixer clean.

🤖 Generated with Claude Code

The storefront's public cart face (PR③ of checkout). Themed private
/cart section (no-store) + POST /ext/shop/cart/{add,update} action routes
(ADR 0017) driving Commerce's CartPort — never its tables. Add-to-cart
forms on the product listing + detail templates; a shop-cart template
with live per-line prices + update/remove.

Security (ADR 0026): the cart is an opaque server-random cookie token
(HttpOnly+SameSite=Lax+Secure); viewing never mints a cart; a
pre-existing cart's mutation requires its per-cart CSRF token (a first
bootstrap add is covered by SameSite=Lax); server-side price throughout;
degrades to a redirect when Commerce is absent. Adds nimbuscms/commerce
as a soft dependency (the CartPort contract, ADR 0019).

PHPStan max, 12 tests, cs-fixer green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit 5870746 into main Aug 31, 2026
2 checks passed
@DanMat
DanMat deleted the feat/cart branch August 31, 2026 03:16
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