Hide 'Clear All' Filter if no filters are selected – Attributes V2

Description

How do I hide the ‘Clear All’ filter button if no filters are selected. Then show it after a user has selected a filter?

Site URL

See show filters button halfway down the page
..

Hey @hello41!

We can help you hide the ‘Clear All’ filter button when no filters are selected and show it only when filters become active. This requires a custom JavaScript solution since our Attributes v2 doesn’t have this as a built-in feature.

The ‘Clear All’ button is always visible by default, but we can make it respond to your filter state changes with some custom code.

This would need a JavaScript approach that:

  • Checks if any filters are currently active
  • Shows the Clear All button only when filters are in use
  • Hides it again when all filters are cleared

The solution would monitor all your filter elements (checkboxes, radios, dropdowns, text inputs) and update the button visibility in real-time.

If you’d like to implement this on your site, @Support-Luis or @Support-Pedro can help you with the specific code solution tailored to your setup.