So, I recently made a SIZECHART on my product page through METAFIELD. I put my whole SIZECHART in SHOP metafield so that it can be accessed gloabally from anywhere just like below
and I'm accessing this in product page like this
And then I wrote code in the product section to and it's working perfectly fine.
PROBLEM: Now, the problem is that instead of adding metafields to each product of the collection one by one. I want it to just put the sizechart to the whole collection so it displays on it's each product. I'm really close to figuring out but the problem is collection metafiled is not accessible to the product section and vice versa, but I want to access the collection's metafield.
Is there a way through which we can access the collection's metafield on the product page? If not then how can we achieve this functionality, is there a workaround or any other tip or trick. Thanks for the answers
Why don't you create a global metafield for each collection, then on the product page run the following logic:
if Product Is In Collection 1
show Collection 1 Metafield
elseif Product Is InCollection 2
show collection 2 Metafield