Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
How do I access the built in product metafields e.g. gender, age group.
I've tried {{ product.metafields.gender }} etc but that doesn't work.
I've seen other posts discussing custom metafields and saying to use a namespace e.g. product.metafields.mynamespace.key
I tried guessing various namespaces to no avail e.g. product.metafields.default.gender, product.metafields.product.gender
Any help much appreciated
Here is the list of fields and their namespaces.
MPN - global UPC - global ISBN - global JAN - global EAN - global age_group - google gender - google google_product_type - google
so you'd try product.metafields.google to see if you had anything of any value at the gender key.
Thanks, you are a life saver. I am now using product.metafields.google.age_group etc
Hi!
i tried to access "MPN" metafield using {{ product.metafields.global.mpn }} or {{ product.metafields.global.MPN }} but it didn't work, although it is working for {{ product.metafields.google.gender }}
Please reply asap, as i am going ahead the deadline. Any help will be highly appreciated.
Hi!
i tried to access "MPN" metafield using {{ product.metafields.global.mpn }} or {{ product.metafields.global.MPN }} but it didn't work, although it is working for {{ product.metafields.google.gender }}
Please reply asap, as i am going ahead the deadline. Any help will be highly appreciated.
{{ product.metafields.global.MPN }} works fine for me.
If you try {{ product.metafields.global | to_json }} it will show everything in the global space and show you the keys.