How do I change filter titles in the new OS 2.0 filter pane (from "Brand" to something else)?

nadimnahas
Tourist
11 0 4

Hi all, 

Is there a way to change the titles in the new Shopify filter pane in OS 2.0?

I want to change "Brand" to "Artist" and "Product Type" to "Theme".

Also I do not understand why shopify does not allow us to filter by tag.... it has to be one of the most important filtering functionalities for stores and it's crazy that they took it out even when it existed in OS 1.0 under Filter Groups!!

nadimnahas_0-1635303072445.png

 

Replies 11 (11)
Evgeniy-M
Excursionist
35 6 7

Hey @nadimnahas .

Shopify supports filtering by metafields out of the box.

So you can attach metafields to products and add filters in the same way how you added the "Product type" and "Brand" filters:

EvgeniyM_0-1635323536102.png

The "Test", "Value 1" and "Value 2" come from the product metafields.

To set up metafields you should go to "Settings -> Metafields -> Products" in the Shopify admin panel.

I used the "Single line text" type metafiled for the above example.

Liquid Ajax Cart — a Javascript library to build Shopify Ajax Carts using plain Liquid templates.
LitExtension
Shopify Partner
2009 335 409

Hi @nadimnahas ,

Please go to snippets/facets.liquid file, change code in line 48 and line 301.
https://i.imgur.com/UcbKkhA.png => https://i.imgur.com/2uTwg8w.png 
https://i.imgur.com/GtPsbKc.png => https://i.imgur.com/g7VxWb1.png 

Code:

{%- if filter.label == 'Brand' -%}
  <span>Artist</span>
{%- elsif filter.label == 'Product type' -%}
  <span>Theme</span>
{%- else -%}
<span>{{ filter.label | escape }}</span>
{%- endif -%}

Hope it clear to you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
medlingtonQPS
Excursionist
16 0 3

Hi Evgeniy-M,

Thats an interesting solution, Im surprised Shopify support havent suggested that to us as a possabliity but then their only solution for everything seems to be buy a paid app.

This would still be a much clunckier solution than the filter by tags as it means setting up a metafield for each possible tag which is quite labourious. 

Im just testing this out and have added the metafield within settings and then applied it to a product however I cannot get it to show as an option within theme > navigation > filters

I set a true or false metafield.

Also is there anyway to alter these metafields on mass as they dont seem to appear on the bulk editor when I try that which again makes this a very time consuming solution.

Evgeniy-M
Excursionist
35 6 7

Hey @medlingtonQPS . Actually I tested with the "Text" metafield type only. 

It is good for filters that can have a lot of different values.

For example you can create "Artist" metafield for products. Then within each product you will specify different artists and then all of them will appear in the filter form. So you don't need to add a lot of different metafields for each artist.

I guess the Shopify support didn't tell you about it because it is a new feature. I didn't see it before. Maybe it has been here for a one week only.

Let me try with the "true false" metafield also.

 

Liquid Ajax Cart — a Javascript library to build Shopify Ajax Carts using plain Liquid templates.
medlingtonQPS
Excursionist
16 0 3

Thanks,

Our main issue is our products can have several tags from the same category at the same time.

So we sell football goals and have a filter for 'ages' for which age groups the goals are suitable.

Many of our goals are suitable for 'kids','teens' and adults so they should appear if any of those filters are pressed. My idea to get around this was to have a metafield for each age range with a true or false input. We had many different filters setup for our products that were similar in that a product could have several of the tags from the same category of tag. Another example is that these goals are used on different surfaces and many are suitable for several different surfaces.

 

nadimnahas
Tourist
11 0 4

Hey there, the solution is very clear but I don't seem to have a facets.liquid file under snippets  

What's the solution to that?

LitExtension
Shopify Partner
2009 335 409

Hi @nadimnahas ,

You don't have to use the Dawn theme? If so, you need to follow the steps:
- Step 1: Go to sections/main-collection-product-grid.liquid file.
If you don't have this file, you need to search 'main-collection' and click on the files displayed in Sections. Ex: https://i.imgur.com/41AYNXQ.png 
- Step 2: Find 'collection.filters' and change code:
<span>{{ filter.label | escape }}</span>
=>
{%- if filter.label == 'Brand' -%}
<span>Artist</span>
{%- elsif filter.label == 'Product type' -%}
<span>Theme</span>
{%- else -%}
<span>{{ filter.label | escape }}</span>
{%- endif -%}
https://i.imgur.com/z2hdFmM.png 
Hope it helps!

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
nadimnahas
Tourist
11 0 4

Hey there, 

I tried that but below are the results:

Screenshot 1.jpg

Screenshot 2.jpg

It only added "Artist" and "Theme" next to the original labels. Any fix?

Evgeniy-M
Excursionist
35 6 7

You should put your new {% if %} ... {% endif %} INSTEAD of the underlined {{ filter.label | escape }} like this :

<div class="filter-group__heading__text">{% if ... %} ... {% endif %}</div>
Liquid Ajax Cart — a Javascript library to build Shopify Ajax Carts using plain Liquid templates.