Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Show custom fields
{{ form_open('cart/add_to_cart', {'class': 'buy-btn-form'}, {'id': product.id, 'variant_id': '', 'cartkey': cart('cartkey')}) }}
{% for option in options %}
{% if option.id in product.available_options %}
{% if option.type == 'textarea' %}
<label>{{ option.name }}</label>
<textarea class="form-control" name="option[{{ option.id }}]"></textarea>
{% elseif option.type == 'textfield' %}
<label>{{ option.name }}</label>
<input class="form-control" name="option[{{ option.id }}]">
{% endif %}
{% endif %}
{% endfor %}
.......
{{ form_close() }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment