hiding one of product types from drop down menu

Solved
Explorer
48 8 7

Hi, I am trying to hide one of criteria(Tag) that I used to create collection. please see the picture below. I like not to show "figure" from the drop down menu. I have many collections and all the page related to action figure shows "figure" word but I want to not to show  on all these pages.   can any one tell me to accomplish that?

Thanks!

my website is www.myherobooth.com

QQQQ1.png

0 Likes
Highlighted
Shopify Partner
1197 162 322

What theme are you using? You'll have to figure out what file that filtering is generated from. Might be collection-template.liquid in your sections folder or something similar. The theme probably loops through all the tags for your products and creates the dropdown menu. So you'll be looking for something like this:

 

<select>
  {% for tag in collection.tags %}
  <option>{{ tag }}</option>
  {% endfor %}
</select>

You'll want to use an unless statement so that it doesnt show if the tag is equal to figure:

 

<select>
  {% for tag in collection.tags %}
    {% unless tag == "figure" %}
      <option>{{ tag }}</option>
    {% endunless %}
  {% endfor %}
</select>

Btw I just caught up on the My Hero Academia manga, binged the hell out of it and read 261 issues in a week.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
Explorer
48 8 7

Thanks! I am using Debut theme. 

Is you suggestion still valid? you think?

Yes, I agree, My Hero Academia, I think it is something special. 

Thanks!!

 

0 Likes
Highlighted
Shopify Partner
1197 162 322

Yup, same applies. I just installed a fresh version of Debut. So if you haven't done any editing on the collection-template.liquid in the Sections folder you should be good to go here.

 

Open collection-template.liquid and scroll to line 89, you should see this:

 

{% for tag in collection.all_tags %}
  {%- assign new_url = tag | link_to_tag: tag | split: 'href="' | last | split: '"' | first -%}
  <option value="{{ new_url }}"{% if current_tags contains tag %} selected="selected"{% endif %}>{{ tag }}</option>
{% endfor %}

You'll want to wrap your unless statement around that, like this:

 

{% for tag in collection.all_tags %}
  {% unless tag == "figure" %}
  	{%- assign new_url = tag | link_to_tag: tag | split: 'href="' | last | split: '"' | first -%}
  	<option value="{{ new_url }}"{% if current_tags contains tag %} selected="selected"{% endif %}>{{ tag }}</option>
  {% endunless %}
{% endfor %}

Should be good to go.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
Explorer
48 8 7

Thank you! I can't try now since I am not in front of my computer but I will try it tonight. 

Thank you for your suggestion! I will let you know if it works. 

Thanks!

0 Likes
Highlighted

Success.

Explorer
48 8 7

Just wanted to let you know that I just tried what you had suggested. 

It worked beautifully!

Thanks! 

0 Likes
Highlighted
Shopify Partner
1197 162 322

Thats good, I'm glad. If you could mark my answer as the solution I would appreciate it. You marked your reply ;)

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
Explorer
48 8 7
Hi,
Since you kindly mentioned that we could discuss what I would like to do, I have actually a question.
How easy it is to accomplish collections within collections….let’s say, as you can see, I have cell phone cover collections. At least I like to make a collection of different type of cellphones(e.g., iphon6, Samsung galaxy s,etc) within the collections so people can see based on the category. So making another collection with the cellphone cover is what I am thinking, I like to do. If I can implement that to other collections I have, that would be even better. I check some solution in shopify, looks like there is one to make subcollections but people are complaining that it only create one column of collections…
I would appreciate any inputs on this.
Thanks!!

www.myherobooth.com

0 Likes