filter in the product
https://n2let9qiifhun86s-53134196927.shopifypreview.com
Hi @niceeee , What theme do you use?
Hi @niceeee ,
Please send me the code of facets.liquid file, I will check it for you
{{ 'component-visual-display.css' | asset_url | stylesheet_tag }}
{{ 'component-show-more.css' | asset_url | stylesheet_tag }}
{%- liquid
assign sort_by = results.sort_by | default: results.default_sort_by
assign total_active_values = 0
if results.url
assign results_url = results.url
else
assign terms = results.terms | escape
assign results_url = '?q=' | append: terms | append: '&options%5Bprefix%5D=last&sort_by=' | append: sort_by
endif
-%}
{% comment %} category {% endcomment %}
{% if filter_type == 'vertical' and enable_fill_category == true %}
{%- for link in section.settings.menu.links -%}
- {%- if link.links != blank -%}
{%- else -%}
{{- link.title | escape -}}
{%- endif -%}
{%- endfor -%}
{% endif %}
{% comment %} category end {% endcomment %}
{%- if filter_type == 'vertical' or filter_type == 'horizontal' -%}
{% comment %} Sorting for vertical filter are grouped with filter when no JS{% endcomment %}
{%- if enable_sorting and filter_type == 'vertical' -%}
{%- endif -%}
{%- endif -%}
{% comment %} Drawer and mobile filter {% endcomment %}
{%- for filter in results.filters -%}
{%- for value in filter.active_values -%}
{%- endfor -%}
{%- if filter.type == "price_range" -%}
{%- if filter.min_value.value != nil or filter.max_value.value != nil -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{% comment %} Sort, product count and filter pills at the end when filter is type of Drawer for the correct tabbing order {% endcomment %}
{%- if enable_sorting and filter_type == 'drawer' -%}
{%- endif -%}
## {%- if results.results_count -%} {{ 'templates.search.results_with_count' | t: terms: results.terms, count: results.results_count }} {%- elsif results.products_count == results.all_products_count -%} {{ 'products.facets.product_count_simple' | t: count: results.products_count }} {%- else -%} {{ 'products.facets.product_count' | t: product_count: results.products_count, count: results.all_products_count }} {%- endif -%}
{%- if filter_type == 'drawer' -%}
{%- endif -%}
veena theme
{{ ‘component-visual-display.css’ | asset_url | stylesheet_tag }}
{{ ‘component-show-more.css’ | asset_url | stylesheet_tag }}
{%- liquid
assign sort_by = results.sort_by | default: results.default_sort_by
assign total_active_values = 0
if results.url
assign results_url = results.url
else
assign terms = results.terms | escape
assign results_url = ‘?q=’ | append: terms | append: ‘&options%5Bprefix%5D=last&sort_by=’ | append: sort_by
endif
-%}
{% comment %} category {% endcomment %}
{% if filter_type == ‘vertical’ and enable_fill_category == true %}
-
{%- for link in section.settings.menu.links -%}
-
{%- if link.links != blank -%}
{{- link.title | escape -}} {% render 'icon-caret' %} -
{%- for childlink in link.links -%}
-
{%- if childlink.links == blank -%}
{{ childlink.title | escape }}
{%- else -%}
{{ childlink.title | escape }} {% render 'icon-caret' %} -
{%- for grandchildlink in childlink.links -%}
- {{ grandchildlink.title | escape }} {%- endfor -%}
{%- endfor -%}
{%- endfor -%}
-
{%- if childlink.links == blank -%}
{{ childlink.title | escape }}
{%- else -%}
{%- if filter_type == ‘vertical’ or filter_type == ‘horizontal’ -%}
{{ 'products.facets.filter_by_label' | t }}
{%- endif -%} {%- if filter_type == 'vertical' -%}{{ 'products.facets.filter_by_label' | t }}
{%- endunless -%} {{ 'products.facets.clear_all' | t }}
{{ filter.label | escape }}{%- if filter_type == 'vertical' -%} ({{ filter.active_values.size }}){% endif %}
{% render 'icon-caret' %}
-
{%- for value in filter.values -%}
{% liquid
assign is_disabled = false
if value.count == 0 and value.active == false
assign is_disabled = true
endif
%}
-
{%- liquid
assign swatchfilename = value.label | handle | append: '.' | append: 'png'
assign swatchimage = swatchfilename | file_img_url: '50x50' | prepend: 'https:' | split: '?' | first
assign colorswatchvalue = value.label | downcase | replace: ' ', ''
-%}
{% if has_visual_display %}
{% render 'visual-display', type: value.display.type, value: value.display.value, presentation: filter.presentation %}{% else %} {% endif %} {{- value.label | escape }} ({{ value.count }}) {{ value.label | escape }} ({% if value.count == 1 %}{{ 'products.facets.product_count_simple.one' | t: count: value.count }}{% else %}{{ 'products.facets.product_count_simple.other' | t: count: value.count }}{% endif %})
{%- endfor -%}
-
{%- for value in filter.values -%}
- {% render 'icon-checkmark' %} {{ value.label | escape }} ({{ value.count }}) {{ value.label | escape }} ({% if value.count == 1 %}{{ 'products.facets.product_count_simple.one' | t: count: value.count }}{% else %}{{ 'products.facets.product_count_simple.other' | t: count: value.count }}{% endif %}) {%- endfor -%}
{{ filter.label | escape }}{% render 'icon-caret' %}
{{ 'products.facets.sort_by_label' | t }}
{%- if results.results_count -%} {{ 'templates.search.results_with_count' | t: terms: results.terms, count: results.results_count }} {%- elsif results.products_count == results.all_products_count -%} {{ 'products.facets.product_count_simple' | t: count: results.products_count }} {%- else -%} {{ 'products.facets.product_count' | t: product_count: results.products_count, count: results.all_products_count }} {%- endif -%}
{{ 'products.facets.sort_by_label' | t }}
{% render 'icon-filter' %} {%- if enable_filtering and enable_sorting -%} {{ 'products.facets.filter_and_sort' | t }} {%- elsif enable_filtering -%} {{ 'products.facets.filter_button' | t }} {%- elsif enable_sorting -%} {{ 'products.facets.sort_button' | t }} {%- endif -%} {%- if enable_filtering -%}{{ 'products.facets.filter_button' | t }}{%- endif -%} {%- render 'icon-close' -%}
{%- if enable_filtering and enable_sorting -%} {{ 'products.facets.filter_and_sort' | t }} {%- elsif enable_filtering -%} {{ 'products.facets.filter_button' | t }} {%- elsif enable_sorting -%} {{ 'products.facets.sort_button' | t }} {%- endif -%}
{%- if enable_filtering -%}{{ 'products.facets.filter_button' | t }}{%- endif -%}
{%- if results.results_count -%} {{ 'templates.search.results_with_count' | t: terms: results.terms, count: results.results_count }} {%- elsif results.products_count == results.all_products_count -%} {{ 'products.facets.product_count_simple' | t: count: results.products_count }} {%- else -%} {{ 'products.facets.product_count' | t: product_count: results.products_count, count: results.all_products_count }} {%- endif -%}
-
{%- for link in section.settings.menu.links -%}
-
{%- if link.links != blank -%}
{{- link.title | escape -}} {% render 'icon-caret' %}
-
{%- for childlink in link.links -%}
-
{%- if childlink.links == blank -%}
{{ childlink.title | escape }}
{%- else -%}
{{ childlink.title | escape }} {% render 'icon-caret' %}
-
{%- for grandchildlink in childlink.links -%}
- {{ grandchildlink.title | escape }} {%- endfor -%}
{%- endfor -%}
{%- endfor -%}
-
{%- if childlink.links == blank -%}
{{ childlink.title | escape }}
{%- else -%}
{{ filter.label | escape }}
{% render 'icon-arrow' %}
{% render 'icon-caret' %}
-
{%- for value in filter.values -%}
{% liquid
assign is_disabled = false
if value.count == 0 and value.active == false
assign is_disabled = true
endif
%}
-
{%- liquid
assign swatchfilename = value.label | handle | append: ‘.’ | append: ‘png’
assign swatchimage = swatchfilename | file_img_url: ‘50x50’ | prepend: ‘https:’ | split: ‘?’ | first
assign colorswatchvalue = value.label | downcase | replace: ’ ', ‘’
-%}
<input class=“mobile-facets__checkbox” type=“checkbox” name=“{{ value.param_name }}” value=“{{ value.value }}” id=“Filter-{{ filter.label | escape }}-mobile-{{ forloop.index }}”
{% if value.active %}checked{% endif %}
{% if value.count == 0 and value.active == false %}disabled{% endif %}
{% if filter.label == ‘Color’ %}style="background-color: {{ colorswatchvalue }};{% if images[swatchfilename] != blank %} background-image: url({{ swatchimage }});{% endif %} "{% endif %}>
{% render ‘icon-checkmark’ %}{{ value.label | escape }} ({{ value.count }})
{{ value.label | escape }} ({% if value.count == ‘1’ %}{{ ‘products.facets.product_count_simple.one’ | t: count: value.count }}{% else %}{{ ‘products.facets.product_count_simple.other’ | t: count: value.count }}{% endif %})
{%- endfor -%}
{{ filter.label | escape }}
{% render 'icon-arrow' %}
{% render 'icon-caret' %}
{{ "products.facets.max_price" | t: price: max_price_amount }}
{{ 'products.facets.sort_by_label' | t }}
{%- if results.results_count -%} {{ 'templates.search.results_with_count' | t: terms: results.terms, count: results.results_count }} {%- elsif results.products_count == results.all_products_count -%} {{ 'products.facets.product_count_simple' | t: count: results.products_count }} {%- else -%} {{ 'products.facets.product_count' | t: product_count: results.products_count, count: results.all_products_count }} {%- endif -%}
Hi @niceeee ,
Please change all code:
{{ 'component-visual-display.css' | asset_url | stylesheet_tag }}
{{ 'component-show-more.css' | asset_url | stylesheet_tag }}
{%- liquid
assign sort_by = results.sort_by | default: results.default_sort_by
assign total_active_values = 0
if results.url
assign results_url = results.url
else
assign terms = results.terms | escape
assign results_url = '?q=' | append: terms | append: '&options%5Bprefix%5D=last&sort_by=' | append: sort_by
endif
-%}
{% comment %} category {% endcomment %}
{% if filter_type == 'vertical' and enable_fill_category == true %}
{%- for link in section.settings.menu.links -%}
- {%- if link.links != blank -%}
{%- else -%}
{{- link.title | escape -}}
{%- endif -%}
{%- endfor -%}
{% endif %}
{% comment %} category end {% endcomment %}
{%- if filter_type == 'vertical' or filter_type == 'horizontal' -%}
{% comment %} Sorting for vertical filter are grouped with filter when no JS{% endcomment %}
{%- if enable_sorting and filter_type == 'vertical' -%}
{%- endif -%}
{%- endif -%}
{% comment %} Drawer and mobile filter {% endcomment %}
{%- for filter in results.filters -%}
{%- for value in filter.active_values -%}
{%- endfor -%}
{%- if filter.type == "price_range" -%}
{%- if filter.min_value.value != nil or filter.max_value.value != nil -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{% comment %} Sort, product count and filter pills at the end when filter is type of Drawer for the correct tabbing order {% endcomment %}
{%- if enable_sorting and filter_type == 'drawer' -%}
{%- endif -%}
## {%- if results.results_count -%} {{ 'templates.search.results_with_count' | t: terms: results.terms, count: results.results_count }} {%- elsif results.products_count == results.all_products_count -%} {{ 'products.facets.product_count_simple' | t: count: results.products_count }} {%- else -%} {{ 'products.facets.product_count' | t: product_count: results.products_count, count: results.all_products_count }} {%- endif -%}
{%- if filter_type == 'drawer' -%}
{%- endif -%}