Hide prices on products when price is set to zero

Hi Everyone!

I have been back and forth trying to hide the price section when a product price is set to zero. I am using the Impact theme and have played around with different bits of code, but nothing seems to work. Any suggestions on how to do this?

Thanks a mil.

Hey Mikhailkuzi,

There are a number of threads where this has been discussed/solved, here’s one:

https://community.shopify.com/c/shopify-design/hide-price-only-for-products-priced-at-0-not-just-sold-out/td-p/2131295

You basically just need to wrap the pricing-coding with some ‘if’ tags, like the following:

{% if product.price > 0 %}
  [CODING FOR PRICE GOES HERE]
{% else %}
  [CODING FOR CUSTOM MESSAGE WHEN $0 GOES HERE, OTHERWISE LEAVE BLANK]
{% endif %}

If you’re really having troubles getting this working yourself, then you’ll probably need to hire someone to do the coding for you. I wouldn’t charge much to handle this for you, if you’re interested in hiring me (just email me at support@stephensworld.ca).

Otherwise, you’d want to reach out to one of the Experts/Partners from this page:

https://www.shopify.com/partners/directory/services/store-setup/customize-theme

Cheers,

Stephen