How To: Setup & Merchandise product-specific content on product pages using Shopfiy Product metafields
Difficulty level: intermediate
Coding required: some
Need help? Contact support
This step requires that you have Shopify Online Store 2.0 theme or that you have upgraded your product template to Shopify Online Store 2.0
Upgrading to Shopify Online Store 2.0 resources:
Determine what section you would like to add to a specific product using the Theme Enhance section library
Add the section to your theme code
Determine what parts of the section you want to be product specific
In the image below, each blue box can be product-specific or the same for all products:
F4 section installed on product pageIn this example, it makes the most sense to customize the boxes highlighted below to be product-specific:
I.e. You want the content of "Product Details", the content of "Description", and the content "Features & Care" to be specific to each productThe highlighted fields below make sense to be the same for all products that get this section
I.e. You want the title "Product Details", the title "Description", and the title "Features & Care" to be customizable and the same on all products.Add the metafield configurations to the store using the built-in Shopify metafields editor
This chart illustrates how merchandising works in Shopify for product-specific (per-product) customizations
Wait, my products don't have any fields to merchandise my products
Here is how it works:
Each section that will be displayed with product-specific content will need to have a metafield definition created in the Shopify metafields configuration.
This metafield definition allows you to add content to the traditional product page of the Shopify admin - no new editors to learn
Lightly Theme Enhance sections have metafield definitions ready for you to copy and paste into the Shopify metafields editor.
Instructions to define metafields for each Theme Enhance section are located on the section page, for this demo section see here: F4 section
If you need assistance configuring metafields please contact us at support@lightly.digital
Add product-specific content to each product in the Shopify product editor
After the metafields have been defined, product-specific content is entered in the conventional Shopify admin for the product. Please see Shopify's Adding Values to Metafields for the specifics of doing this.
Merchandise section to use Shopify product metafield content
In Shopify we create a relationship between the Shopify product metafield content and the location that it is displayed on your online storefront.
This relationship is defined using Dynamic data sources in the Shopify theme editor
Locate the field you wish to assign to the metafield data (i.e. care icon image title, care icon image) and click on the Dynamic source button
Use the dynamic source buttonThere can be multiple dynamic sources to assign the section
Dynamic data source options:
Current Block - Product: This current block can have a product assigned to it, so the option is to pull data from this product. This is the LESSER used option.
Current Page - Product: This current product that a user is visiting. This is the MOST used and suggested option.
Branding: This section is used for things that are common across all merchandising points. Think taglines (All our bags come with a 100% no questions asked lifetime guarantee) that you wouldn't want inconsistent or if they had to change you could do them in one fell swoop (Free shipping on all items vs Free shipping on all orders over $100)
How to assign a dynamic data source to a section field:
The metafield definitions created should be visible in the select field shown below
Select the dynamic source from the metafields defined in previous stepsHow to verify a dynamic data source is assigned to a section field:
If you see the 'Edit metafield' in the selection box, the know the metafield is assigned correctly to the dynamic data sourceShopify Documentation on Dyanmic Data Sources:
Preview the section to using metafields data
In order for you to see the section you MUST select the correct product that you would like to merchandise / preview in the Shopify Theme editor. This can be slightly confusing and is a slight limitation of the Shopify Theme Editor
Ensure that the correct product is selected when previewing sections that have metafields as the data source.
Issues viewing your product-specific section?
Theme Enhance sections are designed so that if the content of the section is not present via an assigned field that the section will not show. If an unmerchandised product is selected here, the section will not show. This is by design and intentional.
If you are working on a preview theme and you are having issues viewing your page, please see: How Shopify page templates work
If you need assistance configuring metafields or product specific sections on your theme please contact: support@lightly.digital