Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello community,
I'm new to Shopify API as well as coding, hopefully this is not so stupid question.
What I'm trying to achieve:
Retrieving data from a custom field of product and display it on our headless shopify store
My approach:
1. Find an App that allows me to add a custom field (probabaly a JSON) to the product.
2. Retrieving the data from custom field using Storefront API, looping through the object, and then display it however I want.
My questions:
1. Does the approach make sense to experienced Shopify developers?
2. Is there a recommended App for custom field?
Many thanks!
Cheng-En
You'll also need to make sure you expose metafields to the Storefront API: https://shopify.dev/tutorials/retrieve-metafields-with-storefront-api#expose-metafields-to-the-store...
Not necessary but if you plan to store a lot of extra content in metafields it may make sense to use a separate CMS to manage the extra content then join the data together on the front-end (especially if content editors are less experienced, as updating metafields, especially in JSON isn't very user friendly).
Thanks a lot for the information!
Yes we need to edit a lot extra data. We will probably host the static site on Gatsby so I will check some CMS that works well with it.
No problem and good luck!
If you don't want to host anything yourself I've found Sanity to be a great headless CMS.