From 52a9828b962f88ba49eceda22db75f3c289f0944 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 18 Jun 2026 12:37:23 -0400 Subject: [PATCH] Bouquet builder: mylars from Build category, latex from full catalog Previously both mylar and latex items had to be in the Build category. Now: mylar options = Build category items without showColors; latex options = all showColors items in the catalog, no extra tagging needed. Co-Authored-By: Claude Sonnet 4.6 --- estore/src/components/BouquetPicker.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/estore/src/components/BouquetPicker.tsx b/estore/src/components/BouquetPicker.tsx index 4355d5b..0e83140 100644 --- a/estore/src/components/BouquetPicker.tsx +++ b/estore/src/components/BouquetPicker.tsx @@ -65,14 +65,19 @@ export default function BouquetPicker({ product, onClose }: Props) { fetch(BASE + '/api/catalog').then((r) => r.ok ? r.json() : { items: [] }), fetch(BASE + '/colors.json').then((r) => r.ok ? r.json() : []), ]).then(([{ items }, families]: [{ items: CatalogItem[] }, ColorFamily[]]) => { - const filtered = items.filter((item) => + const inBuild = (item: CatalogItem) => (item.categories ?? []).includes('build') || item.category === 'build' - ) - setBuildItems(filtered) + + // Mylars: anything in the "Build" category that isn't a latex item + const mylars = items.filter((i) => inBuild(i) && !i.showColors) + // Latex: all latex items in the catalog (showColors drives the color picker) + const latex = items.filter((i) => i.showColors) + + setBuildItems([...mylars, ...latex]) setColorFamilies(families) const initMylar: Record = {} - filtered.filter((i) => !i.showColors).forEach((item) => { + mylars.forEach((item) => { const defaultVar = item.variations.find((v) => v.inventory === null || v.inventory > 0) ?? item.variations[0] @@ -186,10 +191,10 @@ export default function BouquetPicker({ product, onClose }: Props) { {loading ? (

Loading…

- ) : buildItems.length === 0 ? ( + ) : mylarItems.length === 0 && latexItems.length === 0 ? (

No items are set up for the bouquet builder yet.
- Add a “Build” category to items in Square to make them available here. + Add a “Build” category to mylar items in Square to make them available here.

) : ( <>