selectVolumeDiscount
selectVolumeDiscount(
productMetafield,shopMetafield,productCollectionIds,now?):VolumeDiscountEntry|null
Defined in: .pnpm/@[email protected]_graphql@[email protected]_typescript@6.0.3/node_modules/@storesynk/core/dist/product/volume-discounts.d.ts:115
THE selection pipeline: candidates = the product’s own volume_discounts
references (products-targeted - being referenced IS the match) ∪ shop-wide
entries whose applies_to.type is all, or collections with the current
product in one of the referenced collections (checked against the product’s
own collection ids - advisory; the Function is authoritative at checkout).
Entries are de-duplicated by metaobject id (product list first), filtered
to status === "active" inside an open date window, and the FIRST
remaining entry in list order wins - one widget per PDP. Returns null when
none remain. Inputs are structural (nodes may carry non-Metaobject
references - they’re skipped), so any query embedding the
VolumeDiscountMetaobject fragment feeds it.
Parameters
Section titled “Parameters”productMetafield
Section titled “productMetafield”{ references?: { nodes: readonly unknown[]; } | null; } | null | undefined
shopMetafield
Section titled “shopMetafield”{ references?: { nodes: readonly unknown[]; } | null; } | null | undefined
productCollectionIds
Section titled “productCollectionIds”readonly string[]
Date
Returns
Section titled “Returns”VolumeDiscountEntry | null