Can someone help me to hide this section if there’s no active filters?
here are the codes I used on that section:
{% if collection.filters.size %}
#### Active Filters
<small> {{ 'Clear all' | link_to: collection.handle }} </small>
{% for filter in collection.filters %}
{% if filter.label == 'Brand' or filter.label == 'Age' or filter.label == "Product type"%}
###### {{ filter.label }}
{% endif %}
{% for filter_value in filter.active_values %}
{{ filter_value.label }}
{% endfor %}
{% if filter.min_value.value or filter.max_value.value %}
###### {{ filter.label }}
{% if filter.min_value.value %}
{{ filter.min_value.value | money_without_trailing_zeros }}
{% else %}
{{ 0 | money_without_trailing_zeros }}
{% endif %}
-
{% if filter.max_value.value %}
{{ filter.max_value.value | money_without_trailing_zeros }}
{% else %}
{{ filter.range_max | money_without_trailing_zeros }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{%- if current_tags -%}
{%- for tag in current_tags -%}
{%- liquid
assign tag_text = tag
assign tag_name = tag | strip
if tag_name contains '_'
assign cat = tag | split: '_' | first
assign tag_text = tag | remove_first: cat | remove_first: '_'
endif
-%}
- {{
tag_text
| link_to_remove_tag: tag_name
| replace: 'title=', 'class="btn btn--small" title='
| replace: '?view=ajax', ''
| replace: 'view=ajax', ''
}}
{%- endfor -%}
{%- endif -%}
