Skip to content

CollectionsFilter

The CollectionsFilter object represents a collection filter in the storefront.

classDiagram
  direction LR
  CollectionsFilter --> CollectionsFilterValuesList
  class CollectionsFilter{
    string name
    bool isActive
    bool hasCounters
    bool isSingleChoiceOnly
    int limit
    CollectionsFilterValuesList values
  }
  class CollectionsFilterValuesList{
  }

Properties

Attribute name Type Description
name string The name of the collections filter.
isActive bool Returns true when collections filter is active.
hasCounters bool Returns true when collections filter has counter that represents number of products meeting the criteria.
isSingleChoiceOnly bool Returns true if collections filter is single choice.
limit number Number of visible options in the filter.
values CollectionsFilterValuesList The CollectionsFilterValuesList object that represents list of CollectionsFilterValue object.

name property

{{ collectionsFilter.name }}
example name

isActive property

{{ collectionsFilter.isActive }}
true

hasCounters property

{{ collectionsFilter.hasCounters }}
true

isSingleChoiceOnly property

{{ collectionsFilter.isSingleChoiceOnly }}
true

limit property

{{ collectionsFilter.limit }}
4

values property

{% for filter in collectionsFilter.values %}
  <p>name: {{ filter.name }}</p>
{% endfor %}
<p>name: example collections filter name 1</p>
<p>name: example collections filter name 2</p>
<p>name: example collections filter name 3</p>