How to get "Free" instead of "$0" as price

Hello, does somebody know who to turn “$0” to “Free” as a displayed on the product page and collection product grid? I use the theme Sense. Thanks in advance!

Hi @Dvdv ,

Just follow the instructions below

  1. Go to Admin page > Online store > themes > Actions > Edit code

  2. Open the main-product.liquid under the Section folder then add the code below.

  3. Find the code below.

{%- render 'price', product: product, use_variant: true, show_badges: true, price_class: 'price--large' -%}
  1. Replace it with the code below.
{% if product.price != 0 %}
              {%- render 'price', product: product, use_variant: true, show_badges: true, price_class: 'price--large' -%}
              {% else %}
              FREE
              {% endif %}

Thanks, now the price is indeed changed on the product page itself which is great and exactly what I ment. But is this also possible for the product collection grid? Because here is still says “$0” instead f “Free”. Thanks in advance again! Appreciate it.

@made4Uo

Hi @Dvdv ,

Just follow the instructions below

  1. Go to Admin page > Online store > themes > Actions > Edit code

  2. Open the card-product.liquid under the Snippet folder.

  3. Find the code below.

{% render 'price', product: card_product, price_class: '' %}
  1. Replace it with the code below.
{% if product.price != 0 %}
              {% render 'price', product: card_product, price_class: '' %}
              {% else %}
              FREE
              {% endif %}

@made4Uo it doesn’t work. The “$0,00” is still there. I send a screen shot.

Weird. Looks like you have a different code in your collection. Are you able to share your website?

Yes, its Readtabs.com

@made4Uo As far as I know the code has never changed, only the css.

Hi @Dvdv ,

My bad. It was the liquid code. I just change the product to card_product

Just follow the instructions below

  1. Go to Admin page > Online store > themes > Actions > Edit code

  2. Open the card-product.liquid under the Snippet folder.

  3. Find the code below.

{% render 'price', product: card_product, price_class: '' %}
  1. Replace it with the code below.
{% if card_product.price != 0 %}
              {% render 'price', product: card_product, price_class: '' %}
              {% else %}
              FREE
              {% endif %}

@made4Uo You are amazing. Thanks a lot!

1 Like

Thanks so much for this code, I was also looking to replace $0.00 with Free, and used it in the featured product code. However, for some reason, the featured products that are not free are no longer showing the correct price. I have a product for £25.00 which now shows at £19.99. Any idea what could be causing that? I’m also using the sense theme.

Hi, I can’t find this code:

{% render ‘price’, product: card_product, price_class: ‘’ %}

I followed the steps Admin page > Online store > themes > Actions > Edit code

Then searched card-product.liquid and I can’t seem to find it.

Thanks for the tip! I sent you a coffee!

Cheers!