Filter
The filter object describes a product or collection filter, including its type, available values, and range information.
Usage Example
{%- comment -%} Display all filters and their values {%- endcomment -%}
{% for filter in collection.filters %}
<h3>{{ filter.label }}</h3>
<ul>
{% for value in filter.values %}
<li>
<a href="{{ value.url_to_add }}">{{ value.label }}</a>
{% if value.active %}(Active){% endif %}
({{ value.count }})
</li>
{% endfor %}
</ul>
{% endfor %}Properties
active_values
Active values for this filter
inactive_values
Inactive values for this filter
label
The display name for this filter. Only attribute filters are localized.
max_value
If this filter is range type, this will return the maximum value for this filter.
min_value
If this filter is range type, this will return the minimun value for this filter.
param_name
Returns the query paramater name for this filter
range_max
If this filter is range type, this will return the possible maximum value if available.
range_min
If this filter is range type, this will return the possible minimum value if available.
type
Returns the filter type
url_to_remove
Returns the current page URL with the filter’s currently applied value parameters removed.
values
Returns values for this filter.
taxonomy_attribute
Returns the taxonomy attribute if this filter is a taxonomy filter.