Do not display Item Variant when Variant has a certain name

Hey there,

I got this snippet in my cart.template.liquid:

{% unless item.variant.title contains 'Default' %}
             

{{ item.variant.title | escape }}

            {% endunless %}

What would i need to add to hide the {{ item.variant.title | escape }} when the variant contains ‘sq’?

The background is: I use some variants that don’t have a correct name but are used for a calculation. They have names like 1.00sq/2.00sq etc. I don’t want those to appear in the cart (and anywhere else, if possible).

I am new to liquid code and therefore have no clue how to solve this.

Hi @rockandstars ,

Please change ‘Default’ => ‘sq’, it will work fine.

{% unless item.variant.title contains 'sq' %}
      

{{ item.variant.title | escape }}

{% endunless %}

Hope it helps!