Skip to Content

Product Option Value

The product_option_value object describes a value for a product option, such as a specific size or color. It provides access to the value’s handle, title, sort order, taxonomy value, selection state, related variant, and image.

Usage Example

{%- comment -%} Render all values for a product option and highlight the selected one {%- endcomment -%} {% for value in product_option.values %} <span>{{ value.title }} (handle: {{ value.handle }}){% if value.selected %} ✓{% endif %}</span> {% endfor %}

Properties

handle

Returns the handle.

title

Returns the title (name) of the value.

sort_order

Returns the sort order.

selected

Returns whether this value is selected.

taxonomy_value_id

Returns the taxonomy value ID.

taxonomy_value

Returns the related taxonomy value for this value.

variant

Returns the related variant for this value, if available.

image

Returns the related image for this value, if available.

Last updated on