Change product from '$0' to 'Free' on collections page

NathanKim
Excursionist
19 0 5

Hi

 

I am using the Label theme and was wondering how to change the price for a free product from '$0' to 'Free' on my collections page. 

 

https://ariasound.co/collections/bundles

Replies 12 (12)

made4Uo
Shopify Partner
3805 713 1129

Hi @NathanKim 

 

You need to add a liquid for this. I am not familiar with the Label theme but you need to find the price code and you can refer to code below

 

{% if product.price == 0 %}
 Free
{% else %}
The regular price code here...
{% endif %}

 

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!

Zqdo
Shopify Partner
803 32 63

You'll have to do this in your code file. Do you have any experience editing the code in your theme files?

banned
NathanKim
Excursionist
19 0 5

Yes, where do I put it?

Zqdo
Shopify Partner
803 32 63

You would have to go to your collections.liquid file (or whatever file it may be), find where the price code would be, and then paste the code given at the top of the page in that section.

 

Let me know if you need further help. Thanks.

banned
NathanKim
Excursionist
19 0 5

Hi, I still can't seem to find the exact file. Could you explain it to me step by step and describe the exact code I need to put in/replace? Thanks.

Zqdo
Shopify Partner
803 32 63

If you go to your code files, what files start with "collection"?

banned
NathanKim
Excursionist
19 0 5

Under sections: 

collection-list.liquid

collection-with-product.liquid

 

Under snippets:

collection-template.liquid

 

There are other sections with the term "collection" in them but the file name doesn't begin with "collection", for example "main-list-collections.liquid".

Zqdo
Shopify Partner
803 32 63

We should be looking at collection-template.liquid. 

 

Click that file, and do a quick search (Command + F) for "price". Does anything appear for that search?

banned
NathanKim
Excursionist
19 0 5

No, I looked for any word that contained or began with 'price' in collection-template.liquid but nothing showed up. 

 

Also to note, this product is linked to a product page that I built through an app in Shopify, not the default product page provided by my theme. 

 

Also I don't know if this is related but in the first line before the liquid code begins it says "{% comment %}theme-check-disable MissingTemplate,UndefinedObject,LiquidTag{% endcomment %}".

Zqdo
Shopify Partner
803 32 63

Can you check collection-product.liquid and do the same search for "price"

 

Thanks.

banned
NathanKim
Excursionist
19 0 5

There isn't a collection-product.liquid but there is a collection-with-product.liquid and has "price" in the code.

 

Zqdo
Shopify Partner
803 32 63

Where does it say price? Can you take a photo or screenshot?

banned