HELP Hide Prices for Products Priced $0 ONLY on Collection Pages and Product Pages - Minimal Theme

Solved
Highlighted
Tourist
16 0 3

Hi! I have collection pages of items I'd like to sell, and collection pages of items that are sold, but that I want to display. I'd like to hide the prices for ONLY the products priced at $0, on the collections pages AND product pages. I have found many solutions across the web, but none of them have worked. The only thing I have successfully done is hide ALL product prices. I'm using the minimal theme with many adjustments already made. Please help! My launch is tomorrow! Thank you very much!

0 Likes
Highlighted

@auroradreamsco You can query the product object for anything over $0 https://shopify.dev/docs/themes/liquid/reference/objects/product#product-price

{% if product.price >= 0 %}
   *SHOW PRODUCT PRICE*
{% endif %}

  

in the minimal theme you'll find the relevant code in product-grid-item.liquid

 

 

Please like and mark my post as a solution if I've helped you, thanks.
0 Likes
Highlighted

Worth noting, I'm assuming what you're doing is selling 1 off products, then once sold reducing price to 0 so they may remain on your store but not be sold.

 

if that is the case i would suggest you use the product.available object and make use of Shopify inventory management, this will mean you don't have to change the prices of your products and prevent them from being purchased

 

{% if product.available %}
   *SHOW PRICE*
{% endif %}
Please like and mark my post as a solution if I've helped you, thanks.
0 Likes
Highlighted
Tourist
16 0 3

thank you for the quick reply! where is the correct place to insert this? 

0 Likes
Highlighted
Astronaut
953 82 114

@auroradreamsco - the code will need to be added to collection and product page

 

if you are not familiar wit coding then you can add me to staff, I will do it 

you are welcome to contact me.
My email - suyash.patankar@gmail.com
0 Likes
Highlighted
Tourist
16 0 3

i have basic experience with the coding, if you let me know exactly which .liquids to add to, i should be good

0 Likes
Highlighted
Tourist
16 0 3

Screenshot (11).pngScreenshot (10).png

0 Likes
Highlighted
Astronaut
953 82 114

it can be if it is used to show all the products

you are welcome to contact me.
My email - suyash.patankar@gmail.com
0 Likes
Highlighted
Tourist
16 0 3

sorry, i don't understand. do i need to add the above snippet to product/collection pages in order to hide the prices of the products that aren't technically available/$0?

0 Likes
Highlighted
Tourist
16 0 3

or do i need to adjust an already existing code? 

0 Likes