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.keytext setting. You type the namespace and key of the metafield, for examplecustom.specifications. This is used by Theme settings and by Product details blocks. Type it exactly, without aproduct.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
| Feature | Where you set it | Default key | Level | Type the code expects |
|---|---|---|---|---|
| Specifications | Product details > Specifications > Metafield namespace and key | custom.specifications | Product | List of metaobjects with the fields label and value (list.metaobject_reference), or multi-line text |
| Documents | Product details > Documents > Metafield namespace and key | custom.documents | Product | List of files (list.file_reference) |
| Compatibility | Product details > Compatibility > Metafield namespace and key | custom.compatibility | Product | List of metaobjects (list.metaobject_reference) |
| Usage | Product details > Usage > Metafield namespace and key | custom.usage | Product | List of single line text, multi-line text, or rich text |
| Retail volume tiers | Theme settings > Pricing > Retail volume tiers metafield | custom.volume_tiers | Product | JSON, for example [{"min": 10, "percent": 5}, {"min": 50, "percent": 10}] |
| Unit label | Theme settings > Pricing > Unit label metafield | custom.unit_label | Variant or product | Single line text |
| Lead time | Theme settings > Inventory > Lead time metafield | custom.lead_time | Variant or product | Single line text |
| Badge | Theme settings > Badges > Custom badge metafield | custom.badge | Product | Single line text, or a list of single line text |
| Key dimensions | Product page > Key dimensions > Card value fields | none, dynamic sources | Product | Any metafield the dynamic source picker offers for a text setting |
| Subheading | Product page > Subheading > Text | none, dynamic source | Product | Any 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: 100Lines 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.
Create a product metafield of type list of files (key
documents).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.
Create a metaobject definition with one field per column. Use a boolean (true or false) field type for yes or no columns.
Create one entry per row.
Create a product metafield of type list of metaobjects (key
compatibility) and add the entries to each product.In the Compatibility block, fill Table columns, one column per line, written as
field_key: Column heading:
make: Make
model: Model
years: Years
fits: FitsThe 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:
Create a product metafield for each dimension, for example single line text “40 mm” (or a type that the picker offers).
In the editor, open the Key dimensions block.
Next to a value field, select the dynamic source icon and choose the metafield.
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
Open a product in the admin and confirm the metafield has a value.
Check that the key in the theme setting is typed exactly like the definition (namespace.key).
For metaobject lists, check the field keys
labelandvalue(specifications) or the keys you wrote in Table columns (compatibility).In the theme editor, an empty Product details block shows a note. The same block is hidden on the live store.