Customization Group
A customization group represents a set of options that can be selected or filled by the customer when purchasing a product. These groups are used for things like extra toppings, engraving text, or additional product features, and can contain various types of options (dropdowns, checkboxes, text fields, etc.).
Usage Example
{%- comment -%} Render all customization groups and their options for a product {%- endcomment -%}
{% for group in product.customization_groups %}
<h3>{{ group.title }}</h3>
{% if group.type == 'select' %}
<select name="{{ group.id }}">
{% for option in group.options %}
<option value="{{ option.id }}">
{{ option.title }}{% if option.price > 0 %} (+{{ option.price | money }}){% endif %}
</option>
{% endfor %}
</select>
{% elsif group.type == 'checkbox' %}
<ul>
{% for option in group.options %}
<li>
<label>
<input type="checkbox" name="{{ group.id }}[]" value="{{ option.id }}">
{{ option.title }}{% if option.price > 0 %} (+{{ option.price | money }}){% endif %}
</label>
</li>
{% endfor %}
</ul>
{% else %}
<ul>
{% for option in group.options %}
<li>
{{ option.title }}{% if option.price > 0 %} (+{{ option.price | money }}){% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}Properties
id
Returns the unique id for this customization group.
name
Returns the name for this customization group.
input_type
Returns the merchant selected type for this customization group. Possible values are: select, radio, checkbox, textarea
must_be_selected
Returns true if this customization group options must be selected in order to add the product to the cart.
options
Lists customization group options.