mgreen
July 11, 2024, 10:27pm
1
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
mgreen
July 12, 2024, 2:12am
3
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
mgreen
July 12, 2024, 2:27am
5
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 %}
mgreen
July 12, 2024, 2:53am
7
@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 %}
mgreen
July 12, 2024, 3:02am
9
@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.