Wocart

@wocart/storefront v3.1.0


@wocart/storefront / index / optionStates

Function: optionStates()

optionStates<V>(product, selection): Record<string, Record<string, OptionState>>

Each value of each option, given the other choices: available when a variant with it and the other choices can be sold, sold_out when that variant exists without stock, unavailable when it is not made.

Type Parameters

V

V extends PickerVariant

Parameters

product

Catalog<V> & object

selection

OptionSelection

Returns

Record<string, Record<string, OptionState>>