Skip to content

feat(products): show-in-store toggle with landing-page exemption - #118

Merged
bighadj22 merged 1 commit into
mainfrom
feat/show-in-store-toggle
Sep 13, 2026
Merged

bighadj22 merged 1 commit into
mainfrom
feat/show-in-store-toggle

Conversation

@bighadj22

Copy link
Copy Markdown
Owner

Summary

Adds a Show in store toggle to the product form so merchants can hide a product from the storefront catalog while keeping it fully sellable through its published landing pages — the common COD pattern of running ad traffic to dedicated funnels without listing the product publicly.

No schema change: products.showInStore already exists (default true).

Behavior

Surface Hidden product (showInStore=false)
Store catalog (GET /store/products) Excluded (unchanged)
Product's store page (GET /store/products/:handle) 404 (unchanged)
Published landing page (GET /store/landing-pages/:slug) Renders fully — variants, offers, inventory, review stats
Orders from its LP (POST /store/orders) Accepted — server-authoritative pricing, LP attribution, stock deduction

The landing-page fetch bypasses only the showInStore gate. The remaining gates (status=ACTIVE, visibility=true, deletedAt=null) still apply — visibility remains the master switch per the products domain contract.

Changes

Server (cod-shared, cod-server)

  • getStoreProductByHandle gains an allowUnlisted option dropping only the showInStore gate; the landing-page handler passes it. Single-round-trip query shape unchanged.
  • OpenAPI route description and store README updated to match.

Dashboard (cod-client-astro)

  • "Show in store" toggle in the Settings card of the product form — sent on create and update, loaded when editing.
  • "Hidden from store" badge on product list rows (desktop + mobile) and the product detail page.
  • Translations in ar / en / fr.

Tests

  • New e2e on real D1 (landing-pages.hidden-product-e2e.test.ts): hidden product renders on its LP in full store-product shape, is absent from the catalog while visible products remain, 404s on its own store page, and orders via the LP succeed with correct pricing, attribution, and stock deduction.
  • Full suites green: cod-server 2066/2066, cod-client-astro 147/147 (incl. three-locale i18n parity guard). Typechecks clean in both packages.

Verification

Deployed and verified live on Cloudflare Workers (server + dashboard): toggle saves, catalog hides the product, LP keeps rendering and accepting orders.

Merchants can now hide a product from the storefront catalog while
keeping it sellable through its published landing pages — the common
COD pattern of running ad traffic to dedicated funnels without listing
the product publicly.

Server:
- getStoreProductByHandle gains an allowUnlisted option that drops
  only the showInStore gate; status/visibility/soft-delete still apply
- the landing-page render path passes allowUnlisted so LPs render the
  full store-product shape (variants, offers, inventory, review stats)
  and accept orders for store-hidden products
- catalog list and the product's own store page remain gated by all
  four green lights (unchanged)

Dashboard:
- "Show in store" toggle in the product form Settings card, sent on
  create and update, loaded when editing
- "Hidden from store" badge on product list rows (desktop + mobile)
  and the product detail page
- ar/en/fr translations for the new strings

Docs: store README + landing-page route description updated to match
the shipped behavior.

Tests: new e2e on real D1 proving the contract — hidden product
renders and sells on its LP (pricing, attribution, stock deduction),
is absent from the store catalog, and 404s on its own store page.
@bighadj22
bighadj22 merged commit cb60004 into main Sep 13, 2026
3 checks passed
@bighadj22
bighadj22 deleted the feat/show-in-store-toggle branch September 13, 2026 23:55
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