How do I hide the price on products I have tagged 'coming soon'?

I would like to hide the price on any products coming soon as these aren’t confirmed until we have received the products.

I managed to find the code to hide the price when using the search function however the price still shows in both the collection page and on the individual product/s.

Hi @mgreen ,

Can you send me the code of price.liquid file, I will check it

Hi @namphan ,

There is no price.liquid file in our theme code… could it be under another section or snippet?

Hi @mgreen ,

Will it be in the snippet, or if you can’t find it, can I send you a contributor invite? I will check it

Hi @namphan ,

We don’t have a price.liquid snippet could it be part of the main-product.liquid as below?

{{ current_variant.price | money }} {% if product.compare_at_price_max > product.price %} {{ 'products.product.regular_price' | t }} {% if current_variant.compare_at_price > current_variant.price %} {{ current_variant.compare_at_price | money }} {% endif %} {% endif %}

Hi @mgreen ,

Please change code:

     
 
{% unless current_variant.available %}

{{ current_variant.price | money }}
                                   
{% if product.compare_at_price_max > product.price %}

{{ 'products.product.regular_price' | t }}

<s>
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}
</s>
{% endif %}
{% endunless %}

@namphan does the code need to mention product.tags ‘Coming Soon’ somewhere?

Hi @mgreen ,

It will check when the product is out of stock, but if you want to check by tag, you can change the code:

     
 
{% unless product.tags contains 'Coming Soon' %}

{{ current_variant.price | money }}
                                   
{% if product.compare_at_price_max > product.price %}

{{ 'products.product.regular_price' | t }}

<s>
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}
</s>
{% endif %}
{% endunless %}

@namphan Thanks, the product still seems to show the price in collections and on the product page. Is there another section I need to add code to?

Hi @mgreen ,

It should work at the product page, if not work can you send me a contributor invite? I will check it.