[**@wocart/storefront v3.1.0**](../../README)

***

[@wocart/storefront](../../README) / [index](../README) / optionStates

# Function: optionStates()

> **optionStates**\<`V`\>(`product`, `selection`): `Record`\<`string`, `Record`\<`string`, [`OptionState`](../type-aliases/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`](../type-aliases/PickerVariant)

## Parameters

### product

`Catalog`\<`V`\> & `object`

### selection

[`OptionSelection`](../type-aliases/OptionSelection)

## Returns

`Record`\<`string`, `Record`\<`string`, [`OptionState`](../type-aliases/OptionState)\>\>
