Product data from metafields and metaobjects

Several product page features read your own product data. You create the data in Shopify (Settings > Custom data), fill it in on products or variants, then point the theme at it in one of two ways:

On this page
  • A namespace.key text setting. You type the namespace and key of the metafield, for example custom.specifications. This is used by Theme settings and by Product details blocks. Type it exactly, without a product.metafields. prefix. A blank or unknown key means the feature shows nothing.
  • A dynamic source. Settings that accept dynamic sources show a small stacked-discs icon next to the field. Select it, choose a product metafield, and the setting reads from it. The editor lists only the metafields whose type the setting can use.

The theme reads the data on the storefront. If a metaobject based block stays empty, check that the metaobject definition allows storefront access, and that the entries are published (active).

Summary

FeatureWhere you set itDefault keyLevelType the code expects
SpecificationsProduct details > Specifications > Metafield namespace and keycustom.specificationsProductList of metaobjects with the fields label and value (list.metaobject_reference), or multi-line text
DocumentsProduct details > Documents > Metafield namespace and keycustom.documentsProductList of files (list.file_reference)
CompatibilityProduct details > Compatibility > Metafield namespace and keycustom.compatibilityProductList of metaobjects (list.metaobject_reference)
UsageProduct details > Usage > Metafield namespace and keycustom.usageProductList of single line text, multi-line text, or rich text
Retail volume tiersTheme settings > Pricing > Retail volume tiers metafieldcustom.volume_tiersProductJSON, for example [{"min": 10, "percent": 5}, {"min": 50, "percent": 10}]
Unit labelTheme settings > Pricing > Unit label metafieldcustom.unit_labelVariant or productSingle line text
Lead timeTheme settings > Inventory > Lead time metafieldcustom.lead_timeVariant or productSingle line text
BadgeTheme settings > Badges > Custom badge metafieldcustom.badgeProductSingle line text, or a list of single line text
Key dimensionsProduct page > Key dimensions > Card value fieldsnone, dynamic sourcesProductAny metafield the dynamic source picker offers for a text setting
SubheadingProduct page > Subheading > Textnone, dynamic sourceProductAny metafield the picker offers for a text setting

The defaults use the custom namespace, which Shopify uses for metafields you create yourself. You can use any namespace and key; change the text setting to match.

Specifications

Shows a two column list of labels and values in the Specifications block of Product details.

Option 1, metaobjects. Create a metaobject definition with two fields whose keys are exactly label and value (both single line text). Create one entry per row, for example label “Thread size”, value “M8”. Create a product metafield of the type list of metaobjects that references this definition (key specifications), and add the entries to each product. Rows with an empty label or value are skipped.

Option 2, multi-line text. Create a product metafield of type multi-line text. Write one row per line as Label: Value:

Thread size: M8
Material: Zinc plated steel
Pack quantity: 100

Lines without a colon or without a value are skipped.

Option 3, text in the block. If the product data is empty, the block shows the Specifications text setting, in the same Label: Value format. It accepts a dynamic source.

Documents

Shows a list of downloadable files, such as datasheets and certificates, in the Documents block.

  1. Create a product metafield of type list of files (key documents).

  2. Add the files to each product.

Each file shows its file name (without extension) and its extension, for example PDF, and opens in a new tab. A single file reference (not a list) is not read. The block shows a count of files next to its name in the chip row.

Compatibility

Shows a table, for example which machines or models a part fits.

  1. Create a metaobject definition with one field per column. Use a boolean (true or false) field type for yes or no columns.

  2. Create one entry per row.

  3. Create a product metafield of type list of metaobjects (key compatibility) and add the entries to each product.

  4. In the Compatibility block, fill Table columns, one column per line, written as field_key: Column heading:

make: Make
model: Model
years: Years
fits: Fits

The first column is styled as the row's lead cell. Boolean fields show “Suitable” or “Not suitable” marks. All other values show as text. If you leave the heading out (fits:), the field key is used with underscores replaced by spaces. Without any Table columns line, nothing is shown.

The Notes setting shows rich text under the table, or on its own when the product has no compatibility data.

Usage

Shows numbered steps or rich text in the Usage block.

  • List of single line text (key usage): each list item is one numbered step.
  • Multi-line text: each line is one numbered step.
  • Rich text: shown as formatted text.

If the product has no usage data, the block shows its Usage text setting instead.

Retail volume tiers

Quantity tiers shown to visitors who do not have business pricing. The metafield is of type JSON and holds a list of tiers, lowest quantity first:

[{"min": 10, "percent": 5}, {"min": 50, "percent": 10}]

min is the quantity where a tier starts and percent is the percentage off the variant price. The theme only displays the tiers. You must also create one matching automatic “Amount off products” discount per tier in Shopify, or customers pay full price in the cart. Full steps are in B2B and wholesale.

Unit label

Text shown after the price, for example “per box” or “each”. The theme shows it exactly as written, so enter the whole phrase. It has no singular or plural form.

The theme looks at the variant metafield first, then at the product metafield with the same key. It appears next to prices on product cards, the product page, the volume pricing line and the volume calculator.

Lead time

Text for products sold on backorder. When a variant tracks inventory, has no stock and still can be bought, the stock label shows your lead time text instead of “Available on backorder”. The text is shown as written, for example “Ships in 10 days”. The variant metafield wins over the product metafield.

Badge

A product metafield of type single line text, or a list of single line text, adds your own badge to the product card and the product gallery, such as “Best seller”. Each list item becomes one badge. A card or gallery shows at most two badges in total, in the order sold out, sale, custom badge, new, trade price, so a custom badge can be pushed out by a sold out or sale badge.

Key dimensions

The Key dimensions block shows up to six cards under the product gallery. Each card has a Label (default: Width, Height, Depth, Weight, Material, Pack quantity) and a Value. The value is a plain text setting.

To fill a card from a metafield:

  1. Create a product metafield for each dimension, for example single line text “40 mm” (or a type that the picker offers).

  2. In the editor, open the Key dimensions block.

  3. Next to a value field, select the dynamic source icon and choose the metafield.

  4. Edit the label if needed.

A card is hidden while its value is empty, so a product with no data for a card does not show it. The whole block is hidden when no card has a value.

The same dynamic source method works for the Subheading block and for the Specifications text, Usage text, Notes and other text settings.

Checking that data shows

  1. Open a product in the admin and confirm the metafield has a value.

  2. Check that the key in the theme setting is typed exactly like the definition (namespace.key).

  3. For metaobject lists, check the field keys label and value (specifications) or the keys you wrote in Table columns (compatibility).

  4. In the theme editor, an empty Product details block shows a note. The same block is hidden on the live store.

Many questions are answered in FAQ and troubleshooting. For help with Steelyard, contact Support.