Shopify themes, liquid, logos, and UX
I want to show what unit the price of a product is referring to e.g. Per kg, Per g, Per 250mL bottle
I don't see any option for this when setting up my products.
I'm using Dawn theme and here is a link to one of my product pages - https://phattai.au/products/broccoli
Password: EPIQMedia
Please let me know if there is a way to accomplish this? It seems like a very simple e-commerce function so I don't know why it wouldn't be available.
Solved! Go to the solution
This is an accepted solution.
Hi @Kani here is a simple guide for you. plz, explain where exactly you want to show that unit.
This is an accepted solution.
Plz, replace the previous code with this one.
It will hide the word Per if there is no unit defined for a product
add the below code after {{ money_price }} and remove the previous one that you added earlier.
{%- if product.metafields.custom.unit %}Per {{ product.metafields.custom.unit }} {% endif -%}
you can add unit via add metafield definition to product
This is an accepted solution.
Hi @Kani here is a simple guide for you. plz, explain where exactly you want to show that unit.
Thanks for that. I'm surprised that such a basic e-commerce function requires us to edit the site's code but it achieved what I wanted so I appreciate the help
This is an accepted solution.
Plz, replace the previous code with this one.
It will hide the word Per if there is no unit defined for a product
add the below code after {{ money_price }} and remove the previous one that you added earlier.
{%- if product.metafields.custom.unit %}Per {{ product.metafields.custom.unit }} {% endif -%}
Fantastic! This is great thank you.
if you want to show unit on sale items plz add the same code on below highlighted plzce in the same price.liquid file.
Is it possible to have this on the collection pages?
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024