45 — Two Storefront Widgets (v1 Requirement, Screen 8.1)
Cursor-ready plan focused only on Screen 8.1: home top-video widget + PDP product-only widget, with contracts, defaults, and rollout checks.
45 — Two Storefront Widgets (v1 Requirement, Screen 8.1)
Section titled “45 — Two Storefront Widgets (v1 Requirement, Screen 8.1)”Source: 02-Implementation-Blueprint.md — Screen 8.1 — Two storefront widgets (v1 requirement).
This document is a build spec only. No code changes are implied until a task references this file.
Related: 05 (widget + read API), 11 (published content controls), 44 (per-product binding rule), 21 (route/file map).
0) Goal (one sentence)
Section titled “0) Goal (one sentence)”Deliver two clearly separated storefront experiences in v1: a home widget for top store-wide videos and a PDP widget for product-scoped testimonials only.
1) Non-negotiable v1 requirement
Section titled “1) Non-negotiable v1 requirement”Merchants must be able to place and control:
- Home widget
- store-wide social proof
- default top 5 video testimonials
- PDP widget
- only testimonials linked to current product
- explicit fallback behavior when product has no testimonials
This is mandatory and should not be collapsed into vague “single widget” behavior without mode clarity.
2) Widget A — Home (Top video reviews)
Section titled “2) Widget A — Home (Top video reviews)”2.1 Functional contract
Section titled “2.1 Functional contract”- Placement: home/index template
- Data scope: shop-wide published testimonials
- Default filter:
mediaType=video - Default count:
limit=5 - Default order: featured first, then newest/sort order (as configured)
2.2 Settings defaults
Section titled “2.2 Settings defaults”homeWidgetEnabled = truehomeMaxItems = 5homeMediaFilter = video_onlyhomeRanking = featured_then_newest
2.3 Empty behavior
Section titled “2.3 Empty behavior”- Show configured empty-state copy (no random fallback unless explicit future setting).
3) Widget B — PDP (Product-only reviews)
Section titled “3) Widget B — PDP (Product-only reviews)”3.1 Functional contract
Section titled “3.1 Functional contract”- Placement: product template
- Data scope:
shopifyProductId == current product id - Product binding source: primary submission product id (see
44)
3.2 Settings defaults
Section titled “3.2 Settings defaults”pdpWidgetEnabled = truepdpMediaFilterconfigurablepdpMaxItemsconfigurable (default e.g. 12)
3.3 Fallback modes (required)
Section titled “3.3 Fallback modes (required)”When no product-specific rows:
show_global_featuredshow_recenthide_widget
Merchant must choose behavior through settings.
4) Theme-extension implementation options
Section titled “4) Theme-extension implementation options”Option A (recommended)
Section titled “Option A (recommended)”Two explicit blocks:
testimonial-widget-home.liquidtestimonial-widget-pdp.liquid
Pros:
- clearer merchant mental model
- fewer misconfiguration errors
- easier support docs
Option B
Section titled “Option B”Single block with widget_mode setting.
Pros: fewer files
Cons: more misconfiguration risk.
For v1 clarity, prefer Option A.
5) API contract split
Section titled “5) API contract split”Public read endpoint must distinguish placement:
- Home query:
placement=home- ignores
product_id
- PDP query:
placement=pdp- requires
product_id - enforces product-only filter before fallback logic
Response contracts should include enough metadata for widget rendering and empty/fallback handling.
6) Data integrity and leakage prevention
Section titled “6) Data integrity and leakage prevention”Critical constraints:
- PDP route must never show another product’s testimonials unless fallback mode explicitly says so.
- Home route should not accidentally inherit PDP product filters.
- Unpublished/unapproved/non-ready media must be excluded in both modes.
Regression tests should specifically cover cross-product leakage.
7) Merchant UX requirements
Section titled “7) Merchant UX requirements”In app admin:
- explain difference between Home and PDP widgets in plain language
- expose separate enable toggles and limits
- provide preview hints for each context
In Theme Editor:
- block labels should be explicit:
- “Testimonial Widget — Home”
- “Testimonial Widget — Product”
8) Rollout strategy
Section titled “8) Rollout strategy”- ship both blocks behind feature flag
- verify on test theme:
- home renders
- PDP product scoping works
- enable progressively for pilot shops
- monitor fallback usage and error rates
9) Acceptance checklist
Section titled “9) Acceptance checklist”- Merchant can add both blocks independently in theme editor.
- Home widget shows top configured video set (default 5).
- PDP widget shows only current product rows.
- Each fallback mode behaves exactly as configured.
- Disabling one widget does not affect the other.
- No cross-product data leakage in PDP mode.
10) Suggested implementation order (for Cursor)
Section titled “10) Suggested implementation order (for Cursor)”- Finalize settings schema for home/pdp separate defaults.
- Implement read API placement split and predicates.
- Build two liquid blocks + shared JS.
- Wire admin settings UI labels and help copy.
- Add integration tests for home vs PDP behavior.
11) References
Section titled “11) References”02-Implementation-Blueprint.md— Screen 8.105-storefront-widgets-and-read-api.md11-published-content-screen-7.md44-per-product-collection-rule-required-blueprint.md21-route-and-file-map-blueprint-section-6.md
12) Note on numbering
Section titled “12) Note on numbering”This folder already includes 05 through 44 plans. This file is 45-....