How to add custom meta field under product name on product page?

Hi - i am trying to add a custom metafield to the product page but can’t work out where to add the code.

So ideally i want

Product Title

<custom meta 1>

<custom meta 2>

Price

Thanks!

2 Likes

In your product-template.liquid file, Ctrl + F and search for “product.title”. You should see something like this:


  {{ product.title }}

Then you can output your metafields below it, let’s assume your metafield namespace is called “product_info” and your two keys are “dimensions” and “color”


  {{ product.title }}

  {{ product.metafields.product_info.dimensions }}

 {{ product.metafields.product_info.color }}

2 Likes

@abe2

thanks post

you have try shopify new feature metafiled object

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

Thankyou for your help - worked great.