The filter object represents a storefront filter.

The filter object has the following attributes:

filter.active_values

Returns an array of filter_value objects that are currently active. Only applies to filters of type list.

filter.inactive_values

Returns an array of filter_value objects that are currently inactive. Only applies to filters of type list.

filter.label

Returns the customer-facing label of the filter.

filter.max_value

Returns a filter_value object for the maximum value of filters of type price_range.

filter.min_value

Returns a filter_value object for the minimum value of filters of type price_range.

filter.param_name

Returns the parameter name of the filter, for example filter.v.option.color.

filter.range_max

Returns the highest product price in the current collection. Only applies to filters of type price_range.

filter.type

Returns the filter type. Can be list or price_range.

filter.urltoremove

Returns the current page URL without the filter's currently applied value parameters.

This example shows a URL with a Color filter of red and a Size filter of L:

/collections/all?filter.v.option.color=red&filter.v.option.size=L

To remove the Color filter, the url_to_remove attribute returns this URL:

/collections/all?filter.v.option.size=L

The page URL parameter is removed.

filter.values

Returns an array of filter_value objects for a filter of type list.