Skip to content

Contribute featured products to the themed home (ADR 0027) - #4

Merged
DanMat merged 1 commit into
mainfrom
feat/featured-products-viewdata
Sep 3, 2026
Merged

DanMat merged 1 commit into
mainfrom
feat/featured-products-viewdata

Conversation

@DanMat

@DanMat DanMat commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The first consumer of the new view-data contributor hinge (core ADR 0027). Registers a StorefrontViewData contributor that feeds a capped list of featured products into the home page's contrib data, so a theme can render a live "featured" row instead of static tiles.

  • Reads only the public CatalogReadPort (active items, coarse availability — no per-visitor data), home-page only, capped at 6 ("a handful, not a feed").
  • Visitor-independent + cache-safe by construction; the theme escapes on render.
  • Degrades to nothing when Inventory is absent or nothing is featured.

Checks

PHPStan (max) + phpunit (28) + cs-fixer green. (CI pulls core dev-main, which now has the ADR-0027 API.)

Pairs with the Aurora "Featured this week" row (separate PR).

🤖 Generated with Claude Code

Register a ViewDataContributor that feeds a capped list of genuinely-featured
products into the home page's `contrib` view data, so a theme can render a live
"featured" row instead of static tiles. Reads only the public CatalogReadPort
(active items, coarse availability), home-page only, capped at 6 — visitor-
independent and cache-safe by construction; the theme escapes on render.

Degrades to nothing when Inventory is absent or nothing is featured.

PHPStan max + phpunit (28) + cs-fixer green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit 4bd4559 into main Sep 3, 2026
2 checks passed
@DanMat
DanMat deleted the feat/featured-products-viewdata branch September 3, 2026 14:43
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