Skip to content

OptionsFilter

The OptionsFilter object represents a list options filter in the storefront.

classDiagram
  direction LR
  OptionsFilter --> OptionsFilterValuesList
  OptionsFilter --> ColorOptionsFilterValuesList
  class OptionsFilter{
    int optionId
    string name
    bool isActive
    bool hasCounters
    bool isSingleChoiceOnly
    int limit
    bool isColor
    ColorOptionsFilterValuesList|OptionsFilterValuesList values
  }
  class OptionsFilterValuesList{
  }
  class ColorOptionsFilterValuesList{
  }

Properties

Attribute name Type Description
optionId int The option id of the options filter.
name string The name of the options filter.
isActive bool Returns true if options filter is active.
hasCounters bool Returns true if options filter has counter that represents number of products meeting the criteria.
isSingleChoiceOnly bool Returns true if options filter is single choice.
limit int Number of visible options in the filter.
isColor bool Returns true if options filter is color type filter.
values OptionsFilterValuesList|ColorOptionsFilterValuesList Returns OptionsFilterValuesList object that represents list of options filters values or ColorOptionsFilterValuesList object when option's type is color.

Examples

optionId property

{{ optionsFilter.optionId }}
4

name property

{{ optionsFilter.name }}
example name

isActive property

{{ optionsFilter.isActive }}
true

hasCounters property

{{ optionsFilter.hasCounters }}
true

isSingleChoiceOnly property

{{ optionsFilter.isSingleChoiceOnly }}
true

limit property

{{ optionsFilter.limit }}
4

isColor property

{{ optionsFilter.isColor }}
true

values property

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