Edit "filter by" in Venture theme without removing the tags on the products

entranced
Excursionist
21 0 3

Hello,

Each product in our shop (Venture) is marked with several tags. These tags are used (what I think) to synchronize inventory balance and price from the wholesaler.
(When the products were imported into Shopify, the tags were included.)
To avoid problems with the synchronization, I do not dare to remove the tags on the products.

In any case, "filter by" becomes quite messy with all the tags. Is there any way to hide / delete all other selections in the filter menu and only show brands so the filtering looks cleaner?

I guess it's not that easy but if there's something in the code I can change it would be great.

 

Thanks in advance!

filtering.jpg

 

0 Likes
Guleria
Shopify Partner
1255 263 345

Hello,

With code you have to exclude the one which you don't want to use.
In simple word you have to define all the tags which you don't want to use. but if they are too many then do vice-versa means with code include only those specific tags which you want to use.
Nut in both cases you need a developer to do this.

Thanks

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate Click here (Its my paypal)
0 Likes
entranced
Excursionist
21 0 3

Hi Guleria,

Thanks for your answer. Exactly, must find a way to exclude all tags in the code except the one with "mark_ "-tags (as in my example).

I will search around a bit and see if I can find someone who has had a similar case.

0 Likes
entranced
Excursionist
21 0 3

 

Okey, maybe I have a solution.

I added this code to collection.filters.liquid

 

        {% assign show_tags = "Mark_*" | split: "," %}
{% for tag in collection.all_tags %}
  {% unless show_tags contains tag %}
     {% continue %}
  {% endunless %}

 

But some way I need to define to show all products containing the tag Mark_ 

Products are tagged like this:

Produkt1 - Mark_Philips

Product2 - Mark_Electrolux

Product3 - Mark_AEG

 

and so on... Any ideas how to define in code to show all products containing Mark_* ?

 

Complete collection.filters.liquid code looks like this now:

 

<div data-section-id="{{ section.id }}" data-section-type="collection-filters">
  {%- if section.settings.product_tags_enable and collection.all_tags.size > 0 -%}
    <div class="collection-sort">
      <label for="SortTags" class="collection-sort__label">{{ 'collections.sorting.title_tags' | t }}</label>
      <select name="SortTags" id="SortTags" aria-describedby="a11y-refresh-page-message a11y-selection-message" class="collection-sort__input">
        <option value="{{ collection.url }}">{{ 'collections.sorting.all_of_collection' | t }}</option>
 
        {% assign show_tags = "Mark_*" | split: "," %}
{% for tag in collection.all_tags %}
  {% unless show_tags contains tag %}
     {% continue %}
  {% endunless %}
        
        
        
        
          {%- 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 -%}
      </select>
    </div>
  {%- endif -%}
  {%- if section.settings.product_sorting_enable -%}
    <div class="collection-sort">
      {%- assign sort_by = collection.sort_by | default: collection.default_sort_by -%}
      <label for="SortBy" class="collection-sort__label">{{ 'collections.sorting.title' | t }}</label>
      <select name="sort_by" id="SortBy" aria-describedby="a11y-refresh-page-message a11y-selection-message" class="collection-sort__input">
        {%- for option in collection.sort_options -%}
          <option value="{{ option.value }}"{% if sort_by == option.value %} selected="selected"{% endif %}>{{ option.name }}</option>
        {%- endfor -%}
      </select>
    </div>
  {%- endif -%}
</div>

{% schema %}
{
  "name": {
    "cs": "Kolekce",
    "da": "Kollektion",
    "de": "Kategorie",
    "en": "Collection",
    "es": "Colección",
    "fi": "Kokoelma",
    "fr": "Collection",
    "hi": "कलेक्शन",
    "it": "Collezione",
    "ja": "コレクション",
    "ko": "컬렉션",
    "nb": "Samling",
    "nl": "Collectie",
    "pl": "Kolekcja",
    "pt-BR": "Coleção",
    "pt-PT": "Coleção",
    "sv": "Produktserie",
    "th": "คอลเลกชัน",
    "tr": "Koleksiyon",
    "vi": "Bộ sưu tập",
    "zh-CN": "收藏",
    "zh-TW": "商品系列"
  },
  "settings": [
    {
      "type": "checkbox",
      "id": "product_tags_enable",
      "label": {
        "cs": "Povolit filtrování podle štítku",
        "da": "Aktivér tagfiltrering",
        "de": "Tag-Filtern erlauben",
        "en": "Enable tag filtering",
        "es": "Habilitar filtro de etiquetas",
        "fi": "Ota tunnisteiden suodatus käyttöön",
        "fr": "Activer le filtrage par balises",
        "hi": "टैग फ़िल्टर करना सक्षम करें",
        "it": "Attiva filtro tag",
        "ja": "タグでの絞り込みを有効にする",
        "ko": "태그 필터링 사용",
        "nb": "Aktiver taggfiltrering",
        "nl": "Filteren op tags inschakelen",
        "pl": "Włącz filtrowanie tagów",
        "pt-BR": "Habilitar filtragem de tag",
        "pt-PT": "Ativar filtragem por etiqueta",
        "sv": "Aktivera taggfiltrering",
        "th": "เปิดใช้การกรองแท็ก",
        "tr": "Etiket filtrelemeyi etkinleştir",
        "vi": "Bật lọc thẻ",
        "zh-CN": "启用标签筛选",
        "zh-TW": "啟用標籤篩選功能"
      },
      "default": true
    },
    {
      "type": "checkbox",
      "id": "product_sorting_enable",
      "label": {
        "cs": "Povolit řazení",
        "da": "Aktivér sortering",
        "de": "Sortieren erlauben",
        "en": "Enable sorting",
        "es": "Habilitar la función ordenar",
        "fi": "Ota lajittelu käyttöön",
        "fr": "Activer le tri",
        "hi": "क्रमबद्ध करना सक्षम करें",
        "it": "Permetti di ordinare",
        "ja": "並べ替えを有効にする",
        "ko": "정렬 사용",
        "nb": "Aktiver sortering",
        "nl": "Sortering inschakelen",
        "pl": "Włącz sortowanie",
        "pt-BR": "Habilitar organização",
        "pt-PT": "Ativar ordenação",
        "sv": "Aktivera sortering",
        "th": "เปิดใช้การจัดเรียง",
        "tr": "Sıralamayı etkinleştir",
        "vi": "Bật sắp xếp",
        "zh-CN": "启用排序",
        "zh-TW": "啟用排序功能"
      },
      "default": true
    }
  ]
}
{% endschema %}

 

Thanks in advance!

0 Likes