<div id="{{ div_id }}"> | |
{% for variant_option in variant.metafields.simple_bundles.variant_options.value %} | |
{% assign option_name_param = variant_option.optionName | downcase | replace: " ", "-" | strip %} | |
<label for="{{ option_name_param }}">{{ variant_option.optionName }}</label> | |
<select id="{{ option_name_param }}" name="properties[{{ variant_option.optionName }}]" required> | |
{% assign option_values = variant_option.optionValues | split: "," %} | |
{% assign option_inventories = variant_option.optionInventories | split: "," %} | |
<option disabled selected value="">Please select an option</option> | |
{% for option_value in option_values %} | |
{% assign value = option_value | strip %} | |
{% if option_inventories[forloop.index0] %} | |
{% assign option_inventory = option_inventories[forloop.index0] | plus: 0 %} | |
<option value="{{ value }}" data-inventory="{{ option_inventory }}" {% if option_inventory < 1 %}disabled{% else %}selected{% endif %}>{{ value }}</option> | |
{% else %} | |
<option value="{{ value }}">{{ value }}</option> | |
{% endif %} | |
{% endfor %} | |
</select> | |
{% endfor %} | |
</div> |