Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!-- 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