Liquid, JavaScript, themes, sales channels
I am having trouble removing or hiding backend product tags from my Shopify storefront. I am familiar with html and js but not liquid syntax.
Here are the codes I have been playing with
{%- for value in filter.values -%}
{%- unless value contains '_' -%}
<li class=" list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}"> {%endunless%}
{%- if value contains '_' -%}{ value = false }
<li class=" list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}">
{%- if filter.(_)value(s) == '_' -%}{ value = false }
{%- else <li class=" list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}" -%}>
{%- if value contains '_' -%}
<li class="remove-list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}">
{%- if value contains '_' -%}
<value_to_remove>
<li class="remove-list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}">
{%- if value contains '_' -%}
<li class=" visually_hidden list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}">
{%- if value contains '_' -%}
<li class="hidden-list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}">
{%- if value contains '_' -%}
{ value_to_remove } <li class=" list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} {% endif %}">
FULL CODE
<fieldset class="facets-wrap parent-wrap {% if filter_type == 'vertical' %} facets-wrap-vertical{% endif %}">
<legend class="visually-hidden">{{ filter.label | escape }}</legend>
<ul
class="{% if filter_type != 'vertical' %} facets__list{% endif %} list-unstyled no-js-hidden"
role="list"
>
{%- for value in filter.values -%}
{%- unless value contains '_' -%}
<li class="list-menu__item facets__item{% if forloop.index > 10 and filter_type == 'vertical' %} show-more-item{% endif %}">
<label
for="Filter-{{ filter.param_name | escape }}-{{ forloop.index }}"
class="facet-checkbox{% if value.count == 0 and value.active == false %} facet-checkbox--disabled{% endif %}"
>
<input
type="checkbox"
name="{{ value.param_name }}"
value="{{ value.value }}"
id="Filter-{{ filter.param_name | escape }}-{{ forloop.index }}"
{% if value.active %}
checked
{% endif %}
{% if value.count == 0 and value.active == false %}
disabled
{% endif %}
>
<svg
width="1.6rem"
height="1.6rem"
viewBox="0 0 16 16"
aria-hidden="true"
focusable="false"
>
<rect width="16" height="16" stroke="currentColor" fill="none" stroke-width="1"></rect>
</svg>
<svg
aria-hidden="true"
class="icon icon-checkmark"
width="1.1rem"
height="0.7rem"
viewBox="0 0 11 7"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M1.5 3.5L2.83333 4.75L4.16667 6L9.5 1"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round" />
</svg>
<span aria-hidden="true">{{ value.label | escape }} ({{ value.count }})</span>
<span class="visually-hidden">
{{- 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 -%}
)</span
>
</label>
</li>
{% endunless %}
{%- endfor -%}
</ul>
{% comment %} No show more for no JS {% endcomment %}
<ul
class="{% if filter_type != 'vertical' %} facets__list{% endif %} no-js-list list-unstyled no-js"
role="list"
>
{%- for value in filter.values -%}
{%- unless value contains '_' -%}
<li class="list-menu__item facets__item">
<label
for="Filter-{{ filter.param_name | escape }}-{{ forloop.index }}-no-js"
class="facet-checkbox{% if value.count == 0 and value.active == false %} facet-checkbox--disabled{% endif %}"
>
<input
type="checkbox"
name="{{ value.param_name }}"
value="{{ value.value }}"
id="Filter-{{ filter.param_name | escape }}-{{ forloop.index }}-no-js"
{% if value.active %}
checked
{% endif %}
{% if value.count == 0 and value.active == false %}
disabled
{% endif %}
>
<svg
width="1.6rem"
height="1.6rem"
viewBox="0 0 16 16"
aria-hidden="true"
focusable="false"
>
<rect width="16" height="16" stroke="currentColor" fill="none" stroke-width="1"></rect>
</svg>
<svg
aria-hidden="true"
class="icon icon-checkmark"
width="1.1rem"
height="0.7rem"
viewBox="0 0 11 7"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M1.5 3.5L2.83333 4.75L4.16667 6L9.5 1"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round" />
</svg>
<span aria-hidden="true">{{ value.label | escape }} ({{ value.count }})</span>
<span class="visually-hidden">
{{- 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 -%}
)</span
>
</label>
</li>
{%- endunless -%}
{%- endfor -%}
</ul>
</fieldset>
I must have written a hundred variations. I was able to hide my backend product tags but not frontend!
Anyone have any solutions?
No comments?? Bump
User | RANK |
---|---|
38 | |
28 | |
13 | |
13 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023