feat(products): show-in-store toggle with landing-page exemption - #118
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.showInStorealready exists (defaulttrue).Behavior
showInStore=false)GET /store/products)GET /store/products/:handle)GET /store/landing-pages/:slug)POST /store/orders)The landing-page fetch bypasses only the
showInStoregate. The remaining gates (status=ACTIVE,visibility=true,deletedAt=null) still apply —visibilityremains the master switch per the products domain contract.Changes
Server (
cod-shared,cod-server)getStoreProductByHandlegains anallowUnlistedoption dropping only theshowInStoregate; the landing-page handler passes it. Single-round-trip query shape unchanged.Dashboard (
cod-client-astro)ar/en/fr.Tests
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.Verification
Deployed and verified live on Cloudflare Workers (server + dashboard): toggle saves, catalog hides the product, LP keeps rendering and accepting orders.