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.

) : ( <>