Why isn't my product.tags code working in Shopify's main-product liquid?

I need to add code in the main-product liquid where if a certain title (I tried using product ID but it would not work) OR tag is not retail, don’t show Case Price.

Nothing I do is working

{% if product.title != “Luxe Reserve Membership - Wholesale Members Only” or product.tags != “RETAIL” %}
{% if product.variants.first.weight != blank %}
Case Weight: {{ product.variants.first.weight | weight_with_unit }}
{% endif %}

Any ideas?

{% endif %}

Hi @Lisajocelynco,

you can try using code

{% if product.title != "Luxe Reserve Membership - Wholesale Members Only"  or product.tags contains "RETAIL" %}
        {% if product.variants.first.weight != blank %}
              Case Weight: {{ product.variants.first.weight | weight_with_unit }}
        {% endif %}
{% endif %}

Hope my solution works perfectly for you!

Best regards,

Victor | PageFly

no, that doesn’t work either. The products that have a RETAIL tag are still showing Case Price. Could the fact that the products have more than one tag be the issue?

Can you share for me the screenshots of product setting tags?

attached is a sample product. Tags are not the same for every product, but all retail products have the RETAIL tag. Also the order of the tags are different on each product.

if you can share the access with me, I will check it carefully it and fix quickly

i dont have admin permission to grant people access

you can try using code

{% if product.title != "Luxe Reserve Membership - Wholesale Members Only"  or product.tags contains "RETAIL" %}      
              Case Weight: {{ product.variants.first.weight | weight_with_unit }}
{% else%}

does not meet the conditions

{% endif %}

no that didn’t work either… I don’t know why it won’t grab the tag??? The product.title part is working just fine…if you look at this example, it didnt even add the “does not meet the conditions” from the new code

This is the whole section…

{{ product.title | escape }}

{% assign current_variant = product.selected_or_first_available_variant %} {% if product.title != "Luxe Reserve Membership - Wholesale Members Only" or product.tags contains "RETAIL" %} Case Weight: {{ product.variants.first.weight | weight_with_unit }} {% else%}

does not meet the conditions

{% endif %}

Hello @lisajocelynco ,
I think I see your issue. it is using northern template. you can see some screenshots

template id is 15633072849102
rest product

it is using template id is 15155157958862

Hi There - I’m so sorry for the late response, for some reason, the response notifications are going to my trash folder so I did not see it until today. How do I fix the fact that some products are using one template and some are using others? How do I add a tag code to fix this issue?

You can try changing the template for this product to the same template

I just looked and all the products on the screenshots you’ve provided are all set to default product…as well as all the other products I randomly looked at. The owner has made some changes since you looked at the template IDs - can you look again, are they still different?

I just checked again and I see it same template but I still don’t see my code.
Can you share again screenshots of the file-added code?