Remove $0.00 label both on product and collection pages

Solved
Highlighted
Tourist
19 0 2

Hi there, I've tried everything so far but I am using the Brooklyn theme and I just need a code that basically will remove any labels that say $0.00 on my product or collection pages. I.e. some of our products are custom made so they are set to $0.00 but I don't want that showing on the collection OR product page..

Thanks! 

0 Likes
Highlighted
Pathfinder
102 11 30

Hi @LissyNEWZEALAND,
Do the products some prices other than $0.00? 
If not you can remove the whole container that says {{variable.price}}

I can help if you can share your help URL.

0 Likes
Highlighted
Tourist
19 0 2

Hi! thanks for your quick reply.

Most products are priced above $100 so I need the prices visible for those.

I just need products where the price is $0.00 to be hidden - not the whole product, just the price label so it is blank instead of $0

 

For example - here https://4npovvp1cpia7c4l-4420272163.shopifypreview.com

 

If you click "All products" then go down to "Wardrobes" or "Kitchens" you can see each says $0.00. I just want that to be blank. 

 

Thank you !

0 Likes
Highlighted

Success.

Shopify Partner
683 160 199

You need to edit following file in your Brooklyn theme.
snippets/product-grid-item.liquid

There you must do 2 things:
First if you hide price then ( -- ) dash will be there so first will remove dash.

1) On Line no 84:

<span class="long-dash">—</span>

Replace with following code:

{% if product.price > 0 %}
  <span class="long-dash">—</span>
 {% endif %}

2) Hide price with 0 value
on line 98:

 {{ product.price | money_without_trailing_zeros }}

Replace with following code:

{% if product.price > 0 %}
   {{ product.price | money_without_trailing_zeros }}
  {% endif %}

Hope this helps!

If helpful then please Like and Accept Solution.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
1 Like
Highlighted
Tourist
19 0 2

It worked perfectly! thank you so much! do you also know how to do the same on the individual product pages? it has worked on the collection page but still shows $0.00 when clicking into a product.

Thanks!

0 Likes
Highlighted

Success.

Shopify Partner
683 160 199

Hey LissyNEWZEALAND,

 

Always welcome. I am happy that solution worked for you and thanks for like and accepted as a solution.

 

As for the product page:

snippets/product-price.liquid on line no 22

{{ variant.price | money }}

replace with :

{%- if variant.price > 0 -%}
    {{ variant.price | money }}
 {%- endif -%}

Hope this works!

 

Thanks again!

If helpful then please Like and Accept Solution.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
1 Like
Highlighted
Tourist
19 0 2

excellent!! thank yoou!

1 Like