Skip to main content

filter_value

A specific value of a filter.

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

Properties

Returns true if the value is currently active. Returns false if not.

Can only return true for filters of type boolean or list.

The number of results related to the filter value.

Returns a value only for boolean and list type filters. Returns nil for price_range type filters.

The visual representation of the filter value when an image is used.

Returns an image drop for the filter value. Requires the filter presentation to be image and for an image to be available. Otherwise, returns nil.

The customer-facing label for the filter value. For example, Red or Rouge.

Returns a value only for boolean and list type filters. Returns nil for price_range type filters.

The URL parameter for the parent filter of the filter value.

For example, filter.v.option.color.

Filters of type price_range include an extra component depending on whether the filter value is for the filter's min_value or max_value. The following table outlines the URL parameter for each:

Value typeURL parameter
min_valuefilter.v.price.gte
max_valuefilter.v.price.lte

The visual representation of the filter value when a swatch is used.

Returns a swatch drop for the filter value. Requires the filter presentation to be swatch and saved color or image content for the swatch. Otherwise, returns nil.

The current page URL with the filter value parameter added.

Note

Any pagination URL parameters are removed.

Anchor to
url_to_remove

The current page URL with the filter value parameter removed.

Note

Any pagination URL parameters are also removed.

The value for the URL parameter. The value is paired with the param_name property.

For example, High will be used in the URL as filter.v.option.strength=High.

Deprecated Properties

The visual representation of the filter value.

Returns a visual representation for the filter value. If no visual representation is available, then nil is returned.

Deprecated

Deprecated in favor of the swatch attribute.

Was this section helpful?