Having trouble getting metafields to display on my site

Hello,

I’m having an issue getting a metafield to appear on my products grid. Currently I have the code {{ product.metafields.global.subtitles }} on the product-grid–indiv-product.liquid page. It creates a ‘p’ tag on the collection list page under the title of the products but it doesn’t populate. I’ve added subtitles to all the products under the bulk editor in the admin section but I’m not having any luck bringing the fields out onto the page.

Any help would be greatly appreciated!

Are the metafields on the product itself or the variant?

You can verify the correct data structure by looking at the metafield json by adding /metafields.json to the end of the admin product or variant link. eg:

Product:

xyz.myshopify.com/admin/products/12345/metafields.json

Variant:

xyz.myshopify.com/admin/products/12345/variants/12345/metafields.json

Hello and thanks very much for responding. It appears that the subtitle metafield turns up on the products themselves and not the variant.

This is what I get when checking your link on a product:

And here is what I’m seeing when I do the same for a variant:

variant.PNG

For further clarification I’m using the ‘Fresh’ theme. (https://themes.shopify.com/themes/fresh/styles/smooth)

https://chrome.google.com/webstore/detail/javascript-and-css-code-b/iiglodndmmefofehaibmaignglbpdald?hl=en

This extension will help format that data

Thanks for the recommendation!

Here are the screen shots using the beautifier.

Product:

Variant:

If you have any idea’s on what I could try to solve the issue that would be amazing!

Thanks very much.

I’ve now figured out the solution to the problem.

I’ll leave it up incase anyone would like to see the resolution.

When you include a snippet you have the option to pass along variables using the with statement. When that happens the snippet name is used as the variable name. This theme changed product to liquidObject.

Using {{ liquidObject.metafields.global.subtitle }} I was able to get the results I was looking for.

Hi Kietharm,

How did you achieve to create metafields that appears on bulk edit?

Currently, we’re trying to use new shopify default metafields, but they are not visible on bulk edit. Also, we cannot show them on product detail page.