Shopify Soultion-Add Dynamic Checkbox using Increment Oprerator

New Member
1 0 0

Here is a code for Dynamic Checkbox using Increment Oprerator in shopify.

 

{% assign optionCount = 0 %}
{% for block in section.blocks %}
{% assign optionCount = optionCount | plus: 1 %}
<div class="radio-buttons">
<input type="checkbox" id="{{ "option" | append: optionCount }}" name="{{ "name" | append: optionCount }}">
<label for="{{ "option" | append: optionCount }}">{{ block.settings.page-2-checkbox | truncate: 50 }}</label>
</div>
{% endfor %}

0 Likes