Display "Free" instead of $0.00 in Debut Theme

Solved
Highlighted
Tourist
7 0 1

Hello :)

Can anyone offer any support of how to show Free instead of $0.00 for items listed with no price.

I´ve tried to replace this code in product-price.liquid - line 23

assign money_price = price | money
-%}

to this

{% if product.price == 0 %}
  {%- assign money_price = "Free!" -%}
{% else %}
  {%- assign money_price = price | money -%}
{% endif %}

 but it doesnt work.

 

Does anyone know, how to solve this problem?

 

Greetings

Sebastian

 

 

0 Likes
Highlighted
Shopify Partner
1590 347 465

Hey @sebastianotto,

Try like this

{% if price == 0 %}
  {%- assign money_price = "Free!" -%}
{% else %}
  {%- assign money_price = price | money -%}
{% endif %}

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
1 Like
Highlighted
Tourist
7 0 1

Hey @dmwwebartisan thank you for your answer. But sadly it doesn´t work.

 

The error:

Liquid syntax error: Unknown tag '{% if price == 0'

shows up.

 

 

0 Likes
Highlighted
Shopify Partner
1590 347 465

This is an accepted solution.

Hey @sebastianotto,

It should work but try to add  code after this statement

  assign money_price = price | money
-%}

means after line no 24

code-price.jpg

I added on line no 25 and it worked but this works only for product page not for collection. So please check.

 

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
1 Like
Highlighted
Tourist
7 0 1

You´re the man @dmwwebartisan! That worked, thank you very much!!

1 Like