How to access product metafields in homepage?

Hi, I have created metafields and working fine in product page. I want to use metafield in Features Porduct Section, but i am unable to find a solution for that. Please help me on this issue.

i have found the below one for pages

{% assign the_handle = page.handle %}
{{ pages.the_handle.metafields.global.logo }}

Same i need for products metafield.

Thanks,

Hi @Gunasekaran ,

You just need to get it like in the product page, it will work fine. And note it must be get under assign product.
Ex: https://i.imgur.com/yHeYrq2.png
Hope it helps!

Hi @Gunasekaran – Strat here from Shopify :slightly_smiling_face:

Product metafields can be rendered whenever you have a product object using liquid. For example, within a featured product section you would need to loop over a collection of products and get the metafields for each one. Here’s a simplified example:

{% for product in collection %}
  {{ product.metafields.namespace.key }}
{% endfor %}

If you want to target specific products without a collection you can do so using the all_products global object. You can retrieve any product object if you know it’s handle:

{{ all_products['insert_product_handle'].metafields.namespace.key }}

I hope that’s helpful!