filter
To learn about supporting filters in your theme, refer to Support storefront filtering.
Properties
- active_
values array of filter_value The values of the filter that are currently active.
The array can have values only for
boolean
andlist
type filters.- false_
value The
false
filter value.Returns a value for
boolean
type filters if the unfiltered view has at least one result with thefalse
filter value. Otherwise, it returnsnil
.- inactive_
values array of filter_value The values of the filter that are currently inactive.
The array can have values only for
boolean
andlist
type filters.- max_
value The highest filter value.
Returns a value only for
type filters. Returns
nil
for other types.- min_
value The lowest filter value.
Returns a value only for
type filters. Returns
nil
for other types.The logical operator used by the filter. Returns a value only for
boolean
andlist
type filters. Returnsnil
for other types.Example: For a filter named
color
with valuesred
andblue
:- If the operator is
, it will filter items that are both red and blue.
- If the operator is
, it will filter items that are either red or blue or both.
Filters that support the
operator:
- Product tags
- Metafields of type
and
Possible values Description AND Includes products that match all buyer selections. OR Includes products that match at least one buyer selection. - If the operator is
Describes how to present the filter values.
Returns a value only for
list
type filters. Returnsnil
for other types.Possible values image swatch text The highest product price within the collection or search results.
Returns a value only for
type filters. Returns
nil
for other types.- true_
value The
true
filter value.Returns a value for
boolean
type filters if the unfiltered view has at least one result with thetrue
filter value. Otherwise, it returnsnil
.The type of the filter.
Possible values boolean list price_range The current page URL with the URL parameter related to the filter removed.
- valuesarray of filter_value
The values of the filter.
The array can have values only for
boolean
andlist
type filters.