Bouquet builder: pull all items from Build category only
Both mylar and latex items come from the Build category in Square. Add the 11" latex item to Build and it automatically gets the color picker. Add any mylar/foil item to Build and it gets a quantity picker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
52a9828b96
commit
b3df81fb25
@ -68,10 +68,10 @@ export default function BouquetPicker({ product, onClose }: Props) {
|
|||||||
const inBuild = (item: CatalogItem) =>
|
const inBuild = (item: CatalogItem) =>
|
||||||
(item.categories ?? []).includes('build') || item.category === 'build'
|
(item.categories ?? []).includes('build') || item.category === 'build'
|
||||||
|
|
||||||
// Mylars: anything in the "Build" category that isn't a latex item
|
// Everything in the Build category — non-showColors items get quantity pickers,
|
||||||
|
// showColors items (e.g. the 11" latex) get the color picker treatment
|
||||||
const mylars = items.filter((i) => inBuild(i) && !i.showColors)
|
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) => inBuild(i) && i.showColors)
|
||||||
const latex = items.filter((i) => i.showColors)
|
|
||||||
|
|
||||||
setBuildItems([...mylars, ...latex])
|
setBuildItems([...mylars, ...latex])
|
||||||
setColorFamilies(families)
|
setColorFamilies(families)
|
||||||
@ -191,10 +191,10 @@ export default function BouquetPicker({ product, onClose }: Props) {
|
|||||||
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<p className="has-text-grey has-text-centered" style={{ padding: '2rem' }}>Loading…</p>
|
<p className="has-text-grey has-text-centered" style={{ padding: '2rem' }}>Loading…</p>
|
||||||
) : mylarItems.length === 0 && latexItems.length === 0 ? (
|
) : buildItems.length === 0 ? (
|
||||||
<p className="has-text-grey has-text-centered" style={{ padding: '2rem' }}>
|
<p className="has-text-grey has-text-centered" style={{ padding: '2rem' }}>
|
||||||
No items are set up for the bouquet builder yet.<br />
|
No items are set up for the bouquet builder yet.<br />
|
||||||
Add a “Build” category to mylar items in Square to make them available here.
|
Add a “Build” category to items in Square to make them available here.
|
||||||
</p>
|
</p>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user