Customization Group Option
A customization group option represents a selectable or fillable option within a product customization group. These options can be used for dropdowns, checkboxes and text fields. Customization group options allow customers to personalize their products by selecting from various choices or entering custom text. Each option can have its own price, image, and other attributes.
Usage Example
{%- comment -%} Render all customization group options for a product, with type-specific markup {%- 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 option.
title
Returns the display name of the option.
original_net_price
Returns the net price without any discounts.
original_price
Returns the price without any discounts (including tax).
net_price
Returns the discounted net price.
price
Returns the discounted price (including tax).
image
Returns the image URL for the option, if available.
tax
Returns the tax amount for the option (price - net_price
).
group
Returns the parent customization_group this option belongs to.
child_group
Returns the child customization_group for this option, if any.
inventory_management
Returns the inventory management system. Returns 'finqu'
or null
if not managed.
stock
Returns the stock quantity for this option.
in_stock
Returns true if the option is in stock or can be oversold.
is_low_on_stock
Returns true if the option is low on stock.
max_length
Textarea only. Returns the maximum allowed length for the text.
min_length
Textarea only. Returns the minimum allowed length for the text.
rows
Textarea only. Returns the number of rows for the text area.
deliverytime
Returns delivery time information as an object:
{
"min": {
"days": Number,
"weeks": Number,
"years": Number
},
"max": {
"days": Number,
"weeks": Number,
"years": Number
}
}
Returns false
if delivery time is not available.