Skip to content

CategoriesFilter

The CategoriesFilter object represents a categories filter in the storefront.

classDiagram
  direction LR
  CategoriesFilter --> CategoriesFilterValuesList
  CategoriesFilter --> CategoriesFilterValue
  class CategoriesFilter{
    string name
    bool isActive
    bool hasCounters
    bool isSingleChoiceOnly
    int limit
    CategoriesFilterValuesList values
    ?CategoriesFilterValue current
    ?CategoriesFilterValue parent
  }
  class CategoriesFilterValuesList{
  }
  class CategoriesFilterValue{
  }

Properties

Attribute name Type Description
name string The name of the categories filter.
isActive bool Returns true if categories filter is active.
hasCounters bool Returns true if categories filter has counter that represents number of products meeting the criteria.
isSingleChoiceOnly bool Returns true if categories filter is single choice.
limit number Number of visible options in the filter.
values null|CategoriesFilterValue Returns CategoriesFilterValuesList object that represents list of categories filters values.
current null|CategoriesFilterValue Returns CategoriesFilterValue object that represents value of categories filter for current category.
parent null|CategoriesFilterValue Returns CategoriesFilterValue object that represents value of categories filter for parent category.

Examples

name property

{{ categoriesFilter.name }}
example name

isActive property

{{ categoriesFilter.isActive }}
true

hasCounters property

{{ categoriesFilter.hasCounters }}
true

isSingleChoiceOnly property

{{ categoriesFilter.isSingleChoiceOnly }}
true

limit property

{{ categoriesFilter.limit }}
4

values property

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

current property

{{ categoriesFilter.current.name }}
name of current categories filter

parent property

{{ categoriesFilter.parent.name }}
name of parent categories filter