Skip to content

AttributesFilter

The AttributesFilter object represents an attribute filter in the storefront.

classDiagram
  direction LR
  AttributesFilter --> AttributesFiltersList
  class AttributesFilter{
    int attributeId,
    string name
    bool isActive
    bool hasCounters
    bool isSingleChoiceOnly
    int limit
    AttributesFilterValuesList values
  }
  class AttributesFiltersList{
  }

Properties

Attribute name Type Description
attributeValueId int The unique identifier of the attributes filter.
name string The name of the attributes filter.
isActive bool Returns true when attributes filter is active.
hasCounters bool Returns true when attributes filter has counter.
isSingleChoiceOnly bool Returns true when attributes filter is single choice.
limit number Number of visible options in the filter.
values AttributesFilterValuesList The AttributesFilterValuesList object that represents list of AttributesFilterValue object.

Examples

attributeId property

{{ attributesFilter.attributeId }}
1

name property

{{ attributesFilter.name }}
example name

isActive property

{{ attributesFilter.isActive }}
true

hasCounters property

{{ attributesFilter.hasCounters }}
true

isSingleChoiceOnly property

{{ attributesFilter.isSingleChoiceOnly }}
true

limit property

{{ attributesFilter.limit }}
3

values property

{% for filter in attributesFilter.values %}
  <p>id: {{ filter.attributeValueId }}</p>
  <p>name: {{ filter.name }}</p>
{% endfor %}
<p>id: 1</p>
<p>name: example filter name 1</p>
<p>id: 2</p>
<p>name: example filter name 2</p>