Hide product price when sold out - Dawn theme

Hi,

Is there a way to hide the product price when the items are sold out?

Using the Dawn theme currently.

Tried following some of the solutions in earlier discussions but they don’t seem to work for the Dawn theme.

Thanks.

1 Like

@jujusnow

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

Hi @KetanKumar , here’s the link

Thanks.

1 Like

@jujusnow

thanks for URL

sorry but i can’t see any sold out product can you please show me

Hi @KetanKumar ,
I have the same question, I would like to hide prices only for sold-out products from list and product view.
URL to my shop - DAWN theme.
Thanks!

1 Like

@rary-tsky

sorry for that isse yes its possible to hide sold out item price to customization code

Hi @KetanKumar , it seems like I’m not the only one with this question! I don’t see any solutions here though. How do you hide the prices for sold out items with the Dawn theme? Store URL.

1 Like

@GatesGems

yes it possible to backend customization code

@KetanKumar I’m glad to hear it. Which files need to be customized? I have tried adding if statements to hide the price in main-product.liquid (such as {% if variant.available == false %}) to no avail. I have also searched “sold” and “price” throughout the backend files and have attempted to modify component-price.css and section-main-product.css, but I am still very new to css. I think it should be very simple to hide the prices, but I am struggling to do so. Any specific instructions on how to do this would be much appreciated.

1 Like

@GatesGems

yes current try this code

@KetanKumar I’m sorry—what code do you mean?

1 Like

@GatesGems

i mean this this code {% if variant.available == false %} as per this code

@GatesGems

This tutorial may help you achieve that. Let me know if you need any further assistance.

Kind regards,
Diego

1 Like

@diego_ezfy thank you, that works very well (but only for product card)

@GatesGems to hide prices in the product grids I modified component-price.css - yes, I know it’s not elegant way but it works for me :wink:

before / after

In the ‘component-price.css’ find:

}

.price–sold-out .price__availability,
.price__regular {
display: block;
}

replace with:

}
.price__availability,
.price__regular {
display: block;
}
.price–sold-out {
display: none;
}

2 Likes

@rary-tsky This solves the problem perfectly! Thank you so much!

It doesnt work. The tutorial

That’s strange as it still works on my page. Make sure you’re on Dawn theme and you’re editing the correct ‘component-price.css’ file and check if all '}’ are in the right place.

Paste/attach your ‘component-price.css’ here, maybe we’ll find the root cause.