I have an alternate product page set up, which reads “Price Available On Request” that directs users to the contact page. However, the price still shows up on the collection page it’s featured on, how can I hide it?
Hello OspreyDC!
In the collection.liquid you will want to look for the following code:
{% assign price = product.price | money %}
{% if product.compare_at_price %}
{% if product.price_varies %}{{ ‘products.general.from_min_price_html’ | t: price: price }}{% else %}{{ price }}{% endif %}
{{ product.compare_at_price | money }}
{% else %}
{% if product.price_varies %}{{ ‘products.general.from_min_price_html’ | t: price: price }}{% else %}{{ price }}{% endif %}
{% endif %}
Once you have found that code, you will want to add {% comment %} to the beginning of that code and then {% endcomment %} to the end.
The end result would look something like this:
{% comment %}
{% assign price = product.price | money %}
{% if product.compare_at_price %}
{% if product.price_varies %}{{ ‘products.general.from_min_price_html’ | t: price: price }}{% else %}{{ price }}{% endif %}
{{ product.compare_at_price | money }}
{% else %}
{% if product.price_varies %}{{ ‘products.general.from_min_price_html’ | t: price: price }}{% else %}{{ price }}{% endif %}
{% endif %}
{% endcomment %}
This should remove the price
Hope this helps let us know
Thanks
Solution1
Hello @OspreyDC ,
Edit product-card-grid.liquid under snippet.
Now here wrap the price code with if condition e.g.
{% if product.template_suffix == 'test' %} {% else %}
Your existing price code here
{% endif %}
You have to use it in the same format just place your existing price code in else condition and change ‘test’ to the alternate name template.
e.g. if your template name is product.alternate then in place of ‘test’ use ‘alternate’
Thanks