Replace price with "Free" for products with a price of £0.00

Is there a way to replace the price of products that are £0.00 with the text “Free Entry”?

Any help much appreciated!

1 Like

Hello @myloart

In the theme code editor, you’ll need to locate the template responsible for displaying product prices. This template may be named something like product.liquid or product-card.liquid. If you’re not sure, it might be within a section like “product-template” or similar.

Replace or modify the code that displays the price with something like this:

{% if product.price == 0.00 %}
Free
{% else %}
{{ product.price | money }}
{% endif %}

This code checks if the product’s price is equal to £0.00 and displays “Free” if true. Otherwise, it displays the regular price.

Thanks for your reply! Is there a way to do it by adding custom CSS. I’m lost when it comes to modifying the code!