Skip to main content

filter

To learn about supporting filters in your theme, refer to Support storefront filtering.

Properties

Anchor to
active_values
array of filter_value

The values of the filter that are currently active.

The array can have values only for boolean and list type filters.

The false filter value.

Returns a value for boolean type filters if the unfiltered view has at least one result with the false filter value. Otherwise, it returns nil.

Anchor to
inactive_values
array of filter_value

The values of the filter that are currently inactive.

The array can have values only for boolean and list type filters.

The customer-facing label for the filter.

The highest filter value.

Returns a value only for price_range type filters. Returns nil for other types.

The lowest filter value.

Returns a value only for price_range type filters. Returns nil for other types.

Anchor to
operator
string from a set of values

The logical operator used by the filter. Returns a value only for boolean and list type filters. Returns nil for other types.

Example: For a filter named color with values red and blue:

  • If the operator is AND, it will filter items that are both red and blue.
  • If the operator is OR, it will filter items that are either red or blue or both.

Filters that support the AND operator:

  • Product tags
  • Metafields of type list.single_line_text_field and list.metaobject_reference
Possible valuesDescription
ANDIncludes products that match all buyer selections.
ORIncludes products that match at least one buyer selection.

The URL parameter for the filter. For example, filter.v.option.color.

Anchor to
presentation
string from a set of values

Describes how to present the filter values.

Returns a value only for list type filters. Returns nil for other types.

Possible values
image
swatch
text

The highest product price within the collection or search results.

Returns a value only for price_range type filters. Returns nil for other types.

The true filter value.

Returns a value for boolean type filters if the unfiltered view has at least one result with the true filter value. Otherwise, it returns nil.

Anchor to
type
string from a set of values

The type of the filter.

Possible values
boolean
list
price_range
Anchor to
url_to_remove

The current page URL with the URL parameter related to the filter removed.

Anchor to
values
array of filter_value

The values of the filter.

The array can have values only for boolean and list type filters.

Was this section helpful?