Isaac Pak
Isaac Pak

Reputation: 4971

How can I create a metafield with the type: product, for a shopify input?

I have made several metafields with the type as product, so I know they work, but in this section they don't show up for this link. I can hardcode the link to a specific product, but I want it to be dynamic using metafields. I'm using the palo alto theme.

enter image description here

and this is the result when I click the dynamic source button:

enter image description here

I'd rather leave any theme customization or coding as a last resort.

Upvotes: 0

Views: 299

Answers (1)

pete
pete

Reputation: 151

A link would take a metafield of type url but you are trying to add a metafield of type product. Type product stores the product object with all its data that's not what you need here if you just need to link to the product page.

Id just set up another metafield of type url and pop the url of the product in there.

I'm not familiar with where you are adding this in the Palo Alto theme but unless this is a section that appears on multiple pages, like product pages or blog pages, where you need to link to a different product on each page you may not need a metafield at all.

Upvotes: 1

Related Questions