Skip to content

getFilters()

The getFilters method is used to get a Filters object that represents filters.

Returned value

The Filters object.

Example

source
{% set filters = ObjectApi.getFilters() %}
{% if filters.producersFilter.isActive %}
    <b>{{ filters.producersFilter.name }}</b>
    <ul>
    {% for value in filters.producersFilter.values %}
        <li>{{ value.name }}{% if filters.producersFilter.hasCounters %} ({{ value.counter }}){% endif %}</li>
    {% endfor %}
    </ul>
{% endif %}
output
<b>Producent</b>
<ul>
    <li>Sony (10)</li>
    <li>Samsung (7)</li>
</ul>