What's your biggest current challenge? Have your say in Community Polls along the right column.

How can I show what unit my product is sold in (Dawn theme)

Solved

How can I show what unit my product is sold in (Dawn theme)

julian-dadang
Shopify Partner
70 0 22

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.

Accepted Solutions (2)
Ahsan_ANC
Shopify Partner
1409 254 325

This is an accepted solution.

Hi @Kani here is a simple guide for you. plz, explain where exactly you want to show that unit.

 

Contact for any custom design? Skype : ahsananc
>Was your question answered? Mark it as an Accepted Solution!
Feel Free to Contact Me at my Email: anc2277@gmail.com


To enhance and customize Shopify search and filter, I use Boost Product Filter & Search

View solution in original post

Ahsan_ANC
Shopify Partner
1409 254 325

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 -%}

 

Contact for any custom design? Skype : ahsananc
>Was your question answered? Mark it as an Accepted Solution!
Feel Free to Contact Me at my Email: anc2277@gmail.com


To enhance and customize Shopify search and filter, I use Boost Product Filter & Search

View solution in original post

Replies 7 (7)

Kani
Shopify Partner
468 125 233

Hi @julian-dadang 

 

you can add unit via add metafield definition to product

Kani_0-1660700926930.png

Kani_1-1660700976507.png

 

 

Hey!! ʕ ᵔᴥᵔ ʔ
Please click 'Like' and ' Accept as Solution' to encourage me to continue sharing my expertise. ♡
If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response. 🙂
Ahsan_ANC
Shopify Partner
1409 254 325

This is an accepted solution.

Hi @Kani here is a simple guide for you. plz, explain where exactly you want to show that unit.

 

Contact for any custom design? Skype : ahsananc
>Was your question answered? Mark it as an Accepted Solution!
Feel Free to Contact Me at my Email: anc2277@gmail.com


To enhance and customize Shopify search and filter, I use Boost Product Filter & Search
julian-dadang
Shopify Partner
70 0 22

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

Ahsan_ANC
Shopify Partner
1409 254 325

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 -%}

 

Contact for any custom design? Skype : ahsananc
>Was your question answered? Mark it as an Accepted Solution!
Feel Free to Contact Me at my Email: anc2277@gmail.com


To enhance and customize Shopify search and filter, I use Boost Product Filter & Search
julian-dadang
Shopify Partner
70 0 22

Fantastic! This is great thank you.

Ahsan_ANC
Shopify Partner
1409 254 325

if you want to show unit on sale items plz add the same code on below highlighted plzce in the same price.liquid file.

 

download (69).png

Contact for any custom design? Skype : ahsananc
>Was your question answered? Mark it as an Accepted Solution!
Feel Free to Contact Me at my Email: anc2277@gmail.com


To enhance and customize Shopify search and filter, I use Boost Product Filter & Search
Sar4
Excursionist
19 0 8

Is it possible to have this on the collection pages?