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

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!

@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

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 %}

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

@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

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

Screenshot (11).png

Screenshot (10).png

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

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?

or do i need to adjust an already existing code?

yes, need to adjust existing coding, but do it only if you know how to else
hire coding expert, or I can check it for you

okay i would like to use this solution:

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 %}

do i change this in product-grid-item.liquid? and what does the line originally say?

not sure what original line says, need to check files for it, not possible
without login

what information do you need to log in and help ?

this is code editing, adding this line will not help, he told you the
logic, not exact solution

add me to staff

@auroradreamsco as you are using the Minimal theme you will need to edit the product-grid-item.liquid as mentioned earlier.

the price is displayed with the {{ price }} is at the bottom of the code ( line 90 )

{% if on_sale %}
   {{ 'products.product.sale_price' | t }}
{% else %}
   {{ 'products.product.regular_price' | t }}
{% endif %}
{{ price }}
{%- assign variant = featured.selected_or_first_available_variant -%}

you will apply the code to the {{ price }} so your code will look like the following

{% if on_sale %}
   {{ 'products.product.sale_price' | t }}
{% else %}
   {{ 'products.product.regular_price' | t }}
{% endif %}
{% if product.available %}
   {{ price }}
{% endif %}
{%- assign variant = featured.selected_or_first_available_variant -%}

If this helps you achieve your goal please mark this a solution to help others searching the community.

Unfortunately Clarke this did not work for me. I still see the $0 on the collections pages on those items that do not have prices, inventory, skus, or anything.

Suyash i sent you the invite. Hoping i can get this fixed today

please check your site, and collection and let me know the update

https://aurora-dreams-co.myshopify.com/collections/gallery-acrylic-pour-paintings

https://aurora-dreams-co.myshopify.com/collections/shop-all-available-products