Hide price when sold out [all free themes]

Hide price when sold out [all free themes]

Your product just went out of stock and you want to hide its price in the meanwhile? Look no further! In this quick tutorial I'll be showing you how to hide the price of all of your sold out products in the Dawn theme.

Here is a live preview of how the end result will look like. In this example, the option "Black / XXL" is sold out.

Making a backup of your current theme

Before diving into the tutorial make sure you download the theme, so in case you face any issues you can easily revert back.

Adding the code to your theme

  1. From your Shopify Admin go to: online store > themes > actions > edit code
  2. Find the file named exactly "main-product.liquid"
  3. Paste the following code at the very bottom of the file:

    gist

    

Conclusion

That is it - now all of the sold out products will automatically have their prices hidden.

Back to blog