Shopify themes, liquid, logos, and UX
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.
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 %}
You'll have to do this in your code file. Do you have any experience editing the code in your theme files?
Yes, where do I put it?
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.
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.
If you go to your code files, what files start with "collection"?
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".
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?
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 %}".
Can you check collection-product.liquid and do the same search for "price"
Thanks.
There isn't a collection-product.liquid but there is a collection-with-product.liquid and has "price" in the code.
Where does it say price? Can you take a photo or screenshot?
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024