Product Option
The product_option object describes a selectable option for a product, such as size or color. It provides access to the option’s handle, title, sort order, taxonomy attribute, and the available values for the option. It also supports combined listings and selection logic.
Usage Example
{%- comment -%} Render a dropdown for a product option {%- endcomment -%}
<label>{{ product_option.title }}:
<select name="option_{{ product_option.handle }}">
{% for value in product_option.values %}
<option value="{{ value.handle }}" {% if product_option.selected_value and product_option.selected_value.handle == value.handle %}selected{% endif %}>{{ value.label }}</option>
{% endfor %}
</select>
</label>Properties
is_for_combined_listing
Returns whether this option is for a combined listing.
handle
Returns the handle.
sort_order
Returns the sort order.
title
Returns the title.
taxonomy_attribute_id
Returns the taxonomy attribute ID.
taxonomy_attribute_handle
Returns the taxonomy attribute handle.
taxonomy_attribute
Returns the related taxonomy attribute for this option.
values
Returns the values for this option.
selected_value
Returns the selected value for this option.