Skip to content

filter_value

A filter_value is returned by filter.values, filter.active_values, the boolean value properties, or a range filter’s minimum and maximum properties. Its parameter names and URLs use the canonical public storefront-filter grammar.

Example

{% for filter in collection.filters %}
<fieldset>
<legend>{{ filter.label }}</legend>
{% for value in filter.values %}
<label>
<input
type="checkbox"
name="{{ value.param_name }}"
value="{{ value.value }}"
{% if value.active %}checked{% endif %}
>
{{ value.label }} ({{ value.count }})
</label>
{% endfor %}
</fieldset>
{% endfor %}

Use url_to_add and url_to_remove for links and chips. These URLs retain the active locale and safe query state while resetting the relevant paginator. Price values are decimal amounts in the storefront currency’s major unit.

Properties

PropertyDescription
filter_value.activetrue when this value is selected in the current collection or search view.
filter_value.countNumber of results associated with the value, or nil for a range bound.
filter_value.displayReserved compatibility field; currently nil.
filter_value.imageImage presentation for the value, or nil unless the parent presentation is image.
filter_value.labelBuyer-facing value label.
filter_value.param_nameCanonical public filter parameter name.
filter_value.sort_orderSeller-configured value position, or nil.
filter_value.swatchColor or pattern swatch presentation, or nil unless the parent presentation is swatch.
filter_value.swatch_color1First configured swatch color, or nil.
filter_value.swatch_color2Second configured swatch color, or nil.
filter_value.swatch_color3Third configured swatch color, or nil.
filter_value.swatch_typeSwatch composition: single, dual, triple, or pattern.
filter_value.url_to_addLocalized URL that applies this value and resets the relevant paginator.
filter_value.url_to_removeLocalized URL that removes this value and resets the relevant paginator.
filter_value.valueSubmitted filter value; price bounds are expressed in storefront major currency units.
filter_value.visual_alt_textAlternative text for an image or pattern presentation, or nil.
filter_value.visual_kindUnderlying visual assignment kind: none, swatch, or image.
filter_value.visual_mediaNarrow public visual-media record, or nil.

See Storefront filtering for complete collection and search forms.

Property list is generated from the storefront engine (FilterValueDrop), so it always matches what your theme can use. Use {{ value | json }} only as a curated debug snapshot; it can omit lazy or otherwise public properties.