How to access product metafields in homepage?

Shopify Partner
17 0 2

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

Same i need for products metafield.


Replies 2 (2)

2860 684 736

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.
Hope it helps!

LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool.
Effortlessly sell on biggest marketplaces like Amazon, Etsy, eBay, Facebook etc with bulk listing tool, real-time sync & smart order management. Use LitCommerce free for 1-year now!

Shopify Staff (Retired)
20 2 13

Hi @Gunasekaran – Strat here from Shopify 🙂

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!

To learn more visit the Shopify Help Center or the Community Blog.