Looking to access your Shopify Metafield product information on your Shogun pages? Great!
Shogun works with Product Metafield data, with a definition. To view your Product Metafields in Shopify, go to Settings > Custom data > Metafields > Products. Make sure you have added some metafields and added metafield data to your Products in order to leverage this element.
Adding Metafields to Your Shogun Page
You can find the Shopify Metafield element next to the other Shopify elements. To add Shopify Metafield information on your page, simply drop the Shopify Metafield element into any product box like any other Product Element.
Selecting a Metafield
Once you have added a Metafield element to your page, select from your list in Element Control to pick which metafield to display on your page. Shogun will preconfigure the first 10 metafields you have in Shopify upon set up. If you don't see the metafield you want to use in this list, manage your metafields.
Managing Your Metafields
If you have metafields created in Shopify that are not appearing on this list, you can update the set of metafield by clicking "Manage metafields..."
Here you can configure which of your metafields you would like to be available to use with Shogun. Once you check off your desired metafields and click 'Save changes', you can use that new metafield within Shogun.
Metafield Data Not Displaying
Shogun will display this message when we cannot find metafield data to display in the Editor:
This can happen in a few different situations:
You have not selected a metafield under Element Controls.
You have selected a metafield, however that specific metafield is blank in Shopify for the product that is connected to the Product Box the metafield element is within.
Shogun has not yet received the webhook update from Shopify to present to you in the Editor.
To resolve this message, double check the product you are working on has the correct metafield information filled in, Save the product in Shopify, and refresh page you are working on in Shogun.
Displaying HTML within Metafields
It is possible to pass HTML through a metafield and render that within a Shogun page. To do so, create a metafield with a Multi-line text type, and paste your HTML into the metafield for your product. Then, make sure to add this new metafield in Shogun via the Metafield Manager if you don't see it available.
Once you add a metafield element to your page and select the metafield that contains this HTML, you should see the HTML displaying within the Editor. Currently there is a limitation where the HTML will render as pure HTML in the Editor, however, when you view the Preview or Live page, the HTML will display as expected.
Passing HTML through a metafield can be useful when working with third party integrations.