How to display metafields on product page

Solved
moolahdigital
New Member
2 0 1

I have created a number of product metafields via Settings > Metafields:

moolahdigital_0-1627087106747.png

How do I go about displaying the value of one of these metafields on the product page itself? I've tried doing a Google search and only get results related to custom metafields made using an app.

Any help would be greatly appreciated!

KetanKumar
Shopify Partner
23196 2339 8589

@moolahdigital 

sorry for this issue your can do without app shopify new feature 

https://shopify.dev/api/liquid/objects/metafield

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Guleria
Shopify Partner
1781 374 530

This is an accepted solution.

Hello @moolahdigital ,

 

Use 

{{ product.metafields.my_fields.product_benefit_3_image_ }}

{{ product.metafields.my_fields.product_benefit_3_text_ }}

{{ product.metafields.my_fields.product_benefit_2_image_ }}

{{ product.metafields.my_fields.product_benefit_2 }}

{{ product.metafields.my_fields.product_benefit_1_image_ }}

{{ product.metafields.my_fields.product_benefit_3_text_ }}



Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
Buy me a coffee ☕ My PayPal

You can follow these steps:
- Step 1: Go to products and select value for each Metafields. Refer https://i.imgur.com/WqyoeMh.png
- Step 2: Create a json template, choose the template for the products you want to create with that json template. Refer https://shopify.dev/themes/architecture/templates#json-templates
Ex: https://github.com/Shopify/dawn/blob/main/templates/product.json
- Step 3: Go to Customize and start selecting Metafields for it.
Hope it clear to you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
0 Likes
moolahdigital
New Member
2 0 1

Thank you @Guleria - this worked perfectly!

0 Likes
Nalinda
Shopify Partner
16 0 4

Hi @Guleria , Can you please let me know how this is work for product reference metafields 

eg: 

{{ item.product.metafields.product.cross_sell_product }}

Do you know how I can get the above product title , image and the handle.

 

Thank you!

0 Likes
emanuelepasin
Tourist
4 1 2

Hi! I'm trying to achieve the same goal but with text metafields.

emanuelepasin_0-1630588150080.png

but then when I try to use them in my product-template.liquid page (see the code below)

<div class="product-highlight">
    <p>{{product.metafields.my_fields.01_product_highlights}}</p>
</div>

I get this error message:

Liquid syntax error (sections/main-product.liquid line 291): Expected id but found number in "{{product.metafields.my_fields.01_product_highlights}}"

Does anyone know how to solve this?

Thanks!

KetanKumar
Shopify Partner
23196 2339 8589

@emanuelepasin 

can you please just remove number of name for example 01 use different text

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
emanuelepasin
Tourist
4 1 2

It worked!!! Super thanks 

KetanKumar
Shopify Partner
23196 2339 8589

@emanuelepasin 

it's my pleasure to help us

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing