Shopify Theme: Debut. How to remove price once item is sold?

New Member
1 0 0

If this has been asked & answered before in regards to my specific shops theme, please link below!

I'd like to remove the price of the item once sold, however leave the item up to showcase. I'd also like to make sure when searched for, in any collections, or on the home page the price once sold is not visible across any page a customer can stumble upon. When I searched for this answer, I could only find answers for a few other themes and tried applying them to my themes HTML code but none seemed to work.

I have a very limited understanding of HTML code from the golden days of myspace (lol) & messing about with layouts, so can get by if it is pointed out where I need to look and what I need to change.

Thank you for any help & guidance!

0 Likes
Excursionist
30 6 11

I can't go into detail, but I can point you in the right direction. You will need to use a conditional statement on each template where a price is shown  and check if the inventory count for that product is 0, and if so, then don't include the code that shows the price. Perhaps someone else could chime in and tell you exactly what you need to do. Since this job would be more like a programming job, your myspace knowledge probably wont be very useful :( rip myspace.

 

https://help.shopify.com/en/themes/liquid

0 Likes
Astronaut
835 95 178

@garrenkeith is correct, you'll need to use an if or an unless statement around the prices with Liquid. I would duplicate your theme so you can track down where you price is and work on that without customers being able to see it, and just in case you mess something up. So on your product.liquid, collection.liquid, and search.liquid look for something like:

 

{{ product.price }}

//or

{{ product.selected_or_first_available_price}}

//or

{{ variant.price }}

//or

{{ variant.selected_or_first_available_price}}

//it could even be something else, it depends on the keyword used

If your products have no variants, it's more than likely going to be product.price you're looking for. Look for your line of code and put something next to the price, anything. Like "~~~~~". Then save and refresh your product page or collection page. If you see what you typed anywhere near your price, you'll know you're in the right spot you need to edit. You have to make sure in your admin on the product page you have the Track Inventory checkbox checked. Then you can use an if statement like:

 

{% if product.available %}
{{ product.price }}
{% endif %}

Then the product price will only show up if it's available, and wont if it's unavailable

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
Shopify Expert
63 9 9

hi

Please add the condition where product price is located 

{% if variant.available  %}
{{ variant.price  |  money }}
{% else %}
 Sold out text if you want to give
{% endif %}

Thank you 

For development please contact with us.

If its help you please mark it as an Accepted Solution 

0 Likes