# Set up Littles' product data

Chapter 7 of the Littles user guide.

Littles' age badges, size tables, certification chips, age warnings and materials and care read product **metafields** in the `custom` namespace, the one Shopify admin uses when you create a definition. You don't need an app or any metaobjects. You only need the metafields for the features you use: a toy shop can skip the size table, a clothing shop the age warning. Every feature hides when its data is empty, and most blocks also have a **fallback** field you can fill instead (chapters 9 and 11), so nothing breaks while you fill them in.

## Step 1: create the product metafield definitions

In admin, go to **Settings › Custom data › Products** and click **Add definition** for each row you need:

1. Type the **Name** (yours to choose; it's what you see when you edit a product).
2. Check the **Namespace and key** under it and change it to exactly the key in the table. Shopify suggests `custom.` plus the name, so a name like "Age range" gives `custom.age_range`, but "Ages" would give `custom.ages`, which the theme won't find. Keys are case-sensitive.
3. Click **Select type** and choose the type in the table. For age range, certifications and skill, choose **Single line text** and then **List of values**; for subtitle and age warning, **Single line text** and **One value**.
4. Add validation if you like (for Age range, **Limit to preset choices** with your ages keeps the values consistent for the filter), then **Save**.

| Name | Namespace and key | Type | Example | What it does |
| --- | --- | --- | --- | --- |
| Age range | `custom.age_range` | Single line text, **List of values** | 0-3 months, 3-6 months, 6-12 months | The age badge on cards and the product page ("Fits 0–12 m"), the age row on the compare page, and, through a Search & Discovery filter, the age chips on collection pages and the Shop by age tiles (chapter 8) |
| Size table | `custom.size_table` | **Multi-line text** | One size per line in the pipe format below | Replaces Theme settings › Sizing › **Default size table** for this product: the size helper, the size guide and the details under the size tiles (chapter 9) |
| Certifications | `custom.certifications` | Single line text, **List of values** | GOTS certified organic, OEKO-TEX Standard 100 | The certification chips on the product page and in the safety panel, the card chip for your highlighted certification, and the compare page (chapter 11) |
| Age warning | `custom.age_warning` | Single line text, one value | Not suitable for children under 3. Small parts. | The age warning box right above add to bag (chapter 11) |
| Materials | `custom.materials` | **Rich text** | 100% GOTS certified organic cotton rib, 220 gsm. Nickel-free snaps. | Materials in **Materials and care** and on the compare page (chapter 11) |
| Care | `custom.care` | **Rich text** | Machine wash cold with like colours. Line dry in the shade. | Care in **Materials and care** (chapter 11) |
| Subtitle | `custom.subtitle` | Single line text, one value | Organic cotton rib, short sleeves and snaps all the way down. | The line under the title, from the **Product metadata** block set to Subtitle (chapter 6) |
| Skill | `custom.skill` | Single line text, **List of values** | Fine motor, Imaginative play | Toy shops: the Playroom preset's **Shop by skill** tiles, through a Search & Discovery filter (chapter 8). No badge or chip reads it. |

Two more are filled in by review apps, not by you: `reviews.rating` and `reviews.rating_count` give the stars and "4.9 · 128 reviews" in the **Product metadata** block. And a **Spec row** (chapter 6) can show any metafield you create, such as `custom.pieces` for a puzzle.

## The size table's pipe format

`custom.size_table` and the **Default size table** setting use the same format: one size per line, four cells separated by `|`:

```
Size | Age (months) | Height (cm) | Weight (kg)
0-3 m | 0-3 | 56-62 | 4.5-6
3-6 m | 3-6 | 62-68 | 6-7.5
6-12 m | 6-12 | 68-80 | 7.5-10
12-18 m | 12-18 | 80-86 | 10-11.5
2 years | 24-36 | 92-98 | 13-15
6 years | 72+ | 116-122 | 21-23
```

1. **Size**: the size's name, exactly as your size option's value is written (capitals, spaces and full stops don't matter, and "months"/"m" and "years"/"yrs"/"y" match each other, so "6-12 m" finds "6–12 months").
2. **Age in months**: a range such as `6-12`, or an open end such as `72+`. Write years in months: 2 years is `24-36`.
3. **Height in cm**: a range such as `68-80`.
4. **Weight in kg**: a range such as `7.5-10`. Optional; leave the cell out and the weight isn't mentioned.

A hyphen or an en dash both work, and a comma works as a decimal point. Blank lines and lines starting with `#` are skipped, and a first line whose second cell starts with a letter is read as a header. A line with fewer than three cells, or anything other than numbers in the age or height cell, is left out. A product's table needs at least two valid lines; with fewer, the product uses the Default size table.

## How the theme reads what you type

* **Age range**: write each value as `<from>-<to> months`, `<from>-<to> years`, `<from>+ years` or `Newborn`; a hyphen, an en dash or "to" all work, and "months"/"month"/"mos"/"m" and "years"/"year"/"yrs"/"y" are all understood. Cards show short units ("3–6 m", "1–2 yrs", "1 yr"), the product page long ones ("3–6 months"). "0-0 months" and "Newborn" read "Newborn", "0+ months" reads "From birth" and "3+ years" "From 3 yrs". Several values print as one span from the youngest to the oldest: "Fits 0–12 m", or "Fits 6 m–2 yrs" across units. A value the theme can't read prints as you wrote it. A single line text (one value) works too. The Search & Discovery filter and the Shop by age tiles match values **exactly as stored**, so keep to one spelling for each age across your catalog: "3-6 months" and "3–6 months" would be two different filter values.
* **Certifications**: one certification per entry. A single line text with the certifications separated by commas also works for the chips, but the card chip needs a list. Write them the way they should read: the theme prints them as written.
* **Materials** and **Care** are printed as you format them, with bold, links and lists.

## Step 2: fill them in

Open a product in admin and scroll to **Metafields**: every definition you created is listed there. To fill many products at once, use **Bulk edit** from the products list and add the metafield columns.

## What shows without the data

| Missing | What happens |
| --- | --- |
| Age range | The age badge reads the size option instead, when its first and last values read as ages (such as "0-3 m" to "12-18 m"); otherwise no badge. The product can't be found by the age filter. |
| Size table | The Default size table in Theme settings › Sizing is used |
| Certifications | The block's **Certifications** fallback shows instead; with neither, no chips (and no card chip) |
| Age warning | The block's **Warning** shows instead, then Theme settings › Safety › **Default age warning**; with none of them, no warning box. Quick view skips the block's Warning (chapter 11). |
| Materials, Care | The block's **Materials** and **Care** text show instead; with neither, no rows |
| Subtitle | No subtitle line |

In the theme editor, blocks with no data show a sample tagged **Sample** so you can see the design; shoppers never see it.
