Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Created July 25, 2014 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onefriendaday/edafb38a136751f9e84a to your computer and use it in GitHub Desktop.
Save onefriendaday/edafb38a136751f9e84a to your computer and use it in GitHub Desktop.
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