[Supply Theme] Need a clear all filter button for the filter sidebar menu

Tourist
11 0 1

Hi,

Is there a way to add a "Clear All" button to clear the filters selected on the Supply theme sidebar filter list?

If a user selects a tag each in Product Type, Brand, Size and Price, it is troublesome to select them 4 again to start over.

Cheers

0 Likes
Shopify Staff
Shopify Staff
189 0 19

Hello Chongkai,

Keegan here from the Shopify Guru team.

Sounds like a cool feature that our theme support team could get all hooked up for you! Going to send a confirmation email to you privately so we can get this all setup for you no problems. :)

Talk soon!

 

1 Like
Tourist
11 0 1

Haven't hear back from you guys yet.

 

0 Likes
Tourist
11 0 1

BUMP?~lol

0 Likes
Shopify Partner
7 0 2

Hi Keegan,

I need the same functionality for the Supply theme. Could you please share the code here for this?

Many thanks

0 Likes
Tourist
11 0 1

Hi Suzy,

I have actually solved this problem.

You need to look for collection-sidebar.liquid and add the following:

  <div class="grid-item small--one-half medium--one-third">
    <p>
      {% if collection %}
      <a href="/collections/{{collection.handle}}">Clear All Selections</a>
      {% else %}
      <a href="/collections/all">Clear All Selections</a>
      {% endif %}
    </p>
  </div>

Just below

{% if current_tags %}

Cheers

0 Likes
Shopify Partner
7 0 2

Thanks Chongkai,

That worked perfectly. Thanks for replying so quickly.

In case anyone else is looking for the same, I'm using a modified collection-sidebar.liquid where the filter groups are created from linklists. I dropped the code just below the sidebar title so the "Clear All" button is positioned above the filter groups:

{% if current_tags %}
  <p>
    {% if collection %}
      <a href="/collections/{{collection.handle}}">Clear All Selections</a>
      {% else %}
      <a href="/collections/all">Clear All Selections</a>
    {% endif %}
  </p>
  {% endif %}

Cheers.

1 Like
Tourist
4 0 1

Is there a way of only showing the link if a selection  is active?

0 Likes
Shopify Partner
7 0 2

Hi Ben,

Providing you include the code below the

{% if current_tags %}

as per my previous post, the "Clear All" button will only appear if one or more filters are selected.

0 Likes
New Member
1 0 0

This is not working in my site. Can you help me?

0 Likes