How can I hide a $0 product price on the Symmetry theme?

Hi! I’m trying to hide the price on the collection pages/elements when the price is $0 on the Symmetry theme — I already have added:

{% if product.price <= 0 %}
test
{% endif %}

to test the element. So when the price is $0, I can see “test” but what I need to do is add something in so the price is hidden. Any advice?

@sbar - use this condition for code which shows price, so only if price is greater than 0, it will show, something like this

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

Thank you, but that doesn’t work (unless I’m placing it in the wrong place?) I tried that originally tried that, and this is what happens:

@sbar - try {% if product.price > 0.00 %}

Still doesn’t work :disappointed_face: I’m placing it after

in product-block.liquid — could that impact it?

@sbar - try this

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

That just does this (still showing a duplicate of prices and the $0)

which is why I started with {% if product.price <= 0 %}
test
{% endif %} ——— because that doesn’t duplicate the price. any other ideas? thank you!! :slightly_smiling_face:

@sbar - while you are adding our custom code above, are you commenting original code?

here is where I’m placing the code:

@sbar - you are adding this code, it is displaying the price,

and as you can see the code below, one of the price from below codes is been shown hence it is duplicated. You need to adjust your condition with code below, can you add me as collaborator? I can check it

1 Like

I am working on a staff account for this (this is not my store) so I cannot add anyone, but thank you. Can you suggest where I should check this myself? Maybe I’m placing it in the wrong place?

@sbar - please check which price from below code is shown on the page and then put your condition before if to display only if price is greater than 0

so if lets say first price is displayed, then your condition should be added around it rather than adding entire new price

1 Like

Hi @sbar ,

See what is the value of the {{product.price}} in yours. Just put the code below anywhere in your html so you can see its value.

{{product.price}}

Whatever the value, replace the “0” in the code. This works in Dawn but again, it might be different from yours so it is best to check

{% if product.price <= 0 %}
 Test
{% endif %}

Is this to be placed in product-block.liquid? I’ve tried this but it’s not working

Actually, all of the answers were right. It is a placement issue. You have to find the code for the price and wrap it inside the if statement.

1 Like

Thank you - any suggestions of what file I should try out? Maybe not product block, maybe a collection page etc? I’ve looked at a lot of files but didn’t see anything price related -

It might be a snippet file, I am not familiar with Symmetry’s code

@made4Uo @suyash1 Still stuck on this - not finding any snippets or places for the code. Would a preview link be useful? Or any other suggestions? super appreciated!!

@sbar . The code does not mean anything, codes have several placements. You have to find the html in the theme you are working or wherever you want it to show. As previously advised. Put the liquid code {{product.price}} so you can see the output in the browser. Then whatever the output for the zero, copy that to your if statement. You have to do this trial and error. It is hard to give you the exact code without accesing the theme ourselves. All we can provide you is instructions.

@sbar - can you add any one of us as collaborator? We can give exact code only if we can see the code, else you will need to keep trying by adding various code aa per the suggestions