Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Created May 29, 2014 16:22
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/d3b415d684390d55343a to your computer and use it in GitHub Desktop.
Save onefriendaday/d3b415d684390d55343a to your computer and use it in GitHub Desktop.
<!-- The unvisible form for submitting -->
{{ form_open(current_url(), {'id': 'filter_form', 'style': 'display:none;', 'method': 'get'}) }}
{% for prop in properties %}
{% for child in prop.children %}
<input type="checkbox" name="properties[]" value="{{ child.category.id }}" id="filter_property{{ child.category.id }}" {{ selected_properties and child.category.id in selected_properties ? ' checked' : '' }}/>
{% endfor %}
{% endfor %}
{% for option in global_options %}
{% for value in option.values %}
<input type="checkbox" name="options[]" value="{{ value.id }}" id="filter_option{{ value.id }}" {{ selected_options and value.id in selected_options ? ' checked' : '' }}/>
{% endfor %}
{% endfor %}
<input type="checkbox" name="price_max" value="{{ price_max ? price_max : '' }}"{{ price_max ? ' checked' : '' }} />
<input type="checkbox" name="price_min" value="{{ price_min ? price_min : '' }}"{{ price_min ? ' checked' : '' }} />
<input class="order_by_hidden" type="checkbox" name="by" value="price/asc" id="order_price" {{ sort_by == 'sort_price' ? 'checked' : '' }}/>
<input class="order_by_hidden" type="checkbox" name="by" value="bestsellers/asc" id="order_bestseller" {{ sort_by == 'quantity_order' ? 'checked' : '' }}/>
<input class="order_by_hidden" type="checkbox" name="by" value="rating/desc" id="order_rating" {{ sort_by == 'rating' ? 'checked' : '' }}/>
{{ form_close() }}
<!-- End -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment