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

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

mgreen
New Member
5 0 0

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.

Replies 9 (9)

namphan
Shopify Partner
2272 296 333

Hi @mgreen,

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

Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com
mgreen
New Member
5 0 0

Hi @namphan,

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

namphan
Shopify Partner
2272 296 333

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

Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com
mgreen
New Member
5 0 0

Hi @namphan,

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

 

<!-- Price -->     
<div class="product__price" data-price-wrapper> 
<div class="product-price-outer">
<span data-product-price class="product-price">
{{ current_variant.price | money }}
</span>                                   
{% if product.compare_at_price_max > product.price %}
<span
class="visually-hidden"
data-compare-text>
{{ 'products.product.regular_price' | t }}
</span>
<s data-compare-price>
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}
</s>
{% endif %}
 
</div>
namphan
Shopify Partner
2272 296 333

Hi @mgreen,

Please change code:

<!-- Price -->     
<div class="product__price" data-price-wrapper> 
{% unless current_variant.available %}
<div class="product-price-outer">
<span data-product-price class="product-price">
{{ current_variant.price | money }}
</span>                                   
{% if product.compare_at_price_max > product.price %}
<span
class="visually-hidden"
data-compare-text>
{{ 'products.product.regular_price' | t }}
</span>
<s data-compare-price>
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}
</s>
{% endif %}
{% endunless %}
</div>
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com
mgreen
New Member
5 0 0

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

namphan
Shopify Partner
2272 296 333

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:

<!-- Price -->     
<div class="product__price" data-price-wrapper> 
{% unless product.tags contains 'Coming Soon' %}
<div class="product-price-outer">
<span data-product-price class="product-price">
{{ current_variant.price | money }}
</span>                                   
{% if product.compare_at_price_max > product.price %}
<span
class="visually-hidden"
data-compare-text>
{{ 'products.product.regular_price' | t }}
</span>
<s data-compare-price>
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}
</s>
{% endif %}
{% endunless %}
</div>
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com
mgreen
New Member
5 0 0

@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?

namphan
Shopify Partner
2272 296 333

Hi @mgreen,

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

Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com