Product Filters - hide filters with a single value

Hi, is there a way to not show filters where there is only one option? Because it’s useless…

I’m on the Empire theme if that matters.

Thank you

In the Search & Discovery app, find the Filters, select Brand, and delete it.

You misunderstood. This has nothing to do with the Brand filter. I only need it to NOT show up when there is only one option value available. When the search result has items in several brands - the Brand filter shows multiple options, and therefore is needed.

In the theme editor, find facets.liquid. Your theme may be different. Anyway, find the code for the filter on the collection page. Find code that looks like this.

{% case filter.type %}
{% when 'boolean', 'list' %}
xxxx
{% when 'price_range' %}
xxxx
{% endcase %}

Modify the code

{% case filter.type %}
{% when 'boolean', 'list' %}
{% if filter.values.size > 1 %}
xxxx
{% endif %}
{% when 'price_range' %}
xxxx
{% endcase %}

yes there is a way to do that if you are suing the empire theme go to your theme setting
online store >theme> customization
collection page
check fillter
and hide it

hit me up if it workd

You’re right. Filters like Brand with just one option don’t add much value. Luckily, on the Empire theme, there’s a clever way to handle this, but it’s not obvious at first glance.

Let’s just say it can be done, and it makes the filter area much cleaner.

Hi @Bath4All ,

Please go to Actions > Edit code > snippets > facets.liquid file and send me the code.

I will check and guide you

hi @Bath4All

If you’re using the Empire theme, follow these steps:

  • Go to Online Store > Themes > Customize.
  • Navigate to the Collection Page section.
  • Look for the Filter option.

Simply uncheck or hide it to remove the collection title from above the images (if that’s what’s causing the layout).