Currently, in my online store, some of the items are sold out. However, I would like to change my pages so that when an item is sold out(quantity = 0), the price for that item, or variant, is hidden. How can I go about doing that?
Sorry, I am not sure what theme I am using, since I just started using Shopify.
Hey there, you have to put some codes on your product-template.liquid file on your theme. Send me your store link and let me know if you need help to do this. Best of luck!
Youâll need to track down where your price occurs in your product.liquid file. Inside that file you may see something like:
{% section 'product-template' %}
//or
{% include 'product-template' %}
If it says section, youâll be looking for a section file named âproduct-template.liquidâ â If it says include, youâll be looking for a Snippet with that name. Then locate your price in your code. Ctrl + F and search for price. There may be a couple instances of it or more. Youâll be looking for something like:
It could be something different, thereâs no telling really. Youâll need to put something next to it to see if youâre in the right spot. Save, then refresh to see if whatever you typed appears next to the product price. If it does, then you know youâre in the right spot and you can put a conditional statement around it:
{% if product.available %}
{{ product.selected_or_first_available_variant }}
{% endif %}
Iâam trying to do the same with hiding the price when Sold. I have followed your steps closely but when I paste the code into my store near where I tested some text it doesnât hide the sale price. Can you help? www.tasmanianacoustictonewood.com.au/
I need help with this as well. I see the line of code as referenced above but I donât know what condition to put in to hide the price for sold out items.
I am trying to do the same and i have followed the steps above but it doesnât seem to be working? I am trying to hide the price on sold out products but I want to keep the product on show.
I am also trying to hide the price on sold out items whilst still having the Sold Out tag showing. I am using the Debut theme. Its a shame there isnât an easy fix for this
I highly appreciate your hard-working skills as the post you published have some great information which is quite beneficial for me, I hope you will post more like that in the future