Skip to main content

product_option_value

A product option value, such as "red" for the option "color".

Properties

Whether or not the option value is available.

In the context of the selected values for previous options, indicates whether the current option value has any purchaseable combinations in any subsequent options, or whether the current option value is purchaseable if there are no subsequent options. For example, if a product comes in Color/Size/Material and Red/Small/Cotton is selected, available will indicate:

  • Color: Whether any variants for the Color option value are available for purchase.
  • Size: Whether any variants for Color:Red and the Size option value are available for purchase.
  • Material: Whether any variants for Color:Red, Size:Small, and the Material option value are available for purchase.

The ID of the product option value.

The name of the product option value.

Anchor to
product_url

Returns a URL if the option value may be associated with another product, nil otherwise.

/products/gorgeous-wooden-computer

Whether or not the option value is selected.

Returns a swatch drop for the product option value. If there is no saved color or image content for the swatch, then the return value is nil.

The variant associated with this option value combined with the other currently selected option values, if one exists.

If this option value is selected (selected == true), this returns the selected_or_first_available_variant.

If this option value is not selected (selected == false), this returns the variant that is associated with the current option value and the other currently selected option values.

Using optionValue.variant is the recommended way to render product option values availability. For more information, refer to rendering option value availability.

{
"available": true,
"id": 2070385033281,
"name": "Bronze",
"product_url": null,
"selected": true,
"swatch": {},
"variant": {}
}
Was this section helpful?