# Set up Tress's metafields

Chapter 7 of the Tress user guide.

Tress's features read three kinds of data, none of which needs an app:

* **Product and variant metafields** in the `custom` namespace (the one Shopify admin uses when you create a definition): the hair details, care steps, install weights and labels, and the card meta line.
* **Theme settings** in **Theme settings › Hair, lashes and nails**: which of your option names become a length scale, texture chips, a glossary, nail chips and sizes, and the short text maps and tables those features read (landmarks, texture pictures, definitions, cap sizes, tip numbers and widths), plus the sizing kit product.
* **Section settings** for the install builder (its collections, the most bundles and the deal line) and **product tags** for three badges.

Tress doesn't use metaobjects, so there is nothing to set up under Content › Metaobjects except, if you like, the swatches of your texture option (below). You only need the data for the features you use: every feature hides when its data is empty, or falls back to its block or theme settings, so nothing breaks while you fill it in.

In Shopify admin, metafield definitions live under **Settings › Custom data** (called **Metafields and metaobjects** in newer versions of the admin).

## The metafields Tress reads

| Name (yours to choose) | Namespace and key | Owner | Type | Example | What it does |
| --- | --- | --- | --- | --- | --- |
| Hair origin | `custom.hair_origin` | Product | **Single line text**, one value | Single-donor raw Cambodian | **Origin** in Hair details (chapter 11) |
| Grade | `custom.grade` | Product | **Single line text**, one value | 10A | **Grade** in Hair details, as a stat pill or a row |
| Weight per bundle | `custom.weight_grams` | Product **and** Variant (the variant's wins) | **Integer**, one value, in grams | 100 | **Weight per bundle** in Hair details ("100 g", following the chosen variant), and the install builder's total weight (chapter 9) |
| Lace | `custom.lace` | Product | **Single line text**, one value | HD lace, 13×4, free part | **Lace** in Hair details |
| Cap size | `custom.cap_size` | Product | **Single line text**, one value | Fits Small to Large | **Cap size** in Hair details, and the "Find your cap size" link on the Care card |
| Density | `custom.density` | Product | **Single line text**, one value | 150% | **Density** in Hair details, as a stat pill or a row |
| Colouring | `custom.colorable` | Product | **True or false** | True | **Colouring** in Hair details: "Can be dyed and bleached" (true) or "Not for colouring" (false); left empty, no row |
| Lifespan | `custom.lifespan` | Product | **Single line text**, one value | 12+ months with care | **Lifespan** in Hair details |
| Wears | `custom.wears` | Product | **Integer**, one value | 20 | **Wears** in Hair details: "Wear up to 20 times" ("Wear it once" for 1), or a "20 / Wears" stat pill. For lashes and press-ons. |
| Care | `custom.care` | Product | **Rich text** | A numbered list of three steps (below) | The steps on the **Care** card (chapter 11), instead of the Care block's own text |
| Texture | `custom.texture` | Product | **Single line text**, one value | Body wave | The texture's name in the install builder's step 1 (else the product title), and the texture in the card meta line |
| Short name | `custom.short_name` | Product | **Single line text**, one value | 4×4 closure | The closure's or frontal's name in the install's label ("Body wave · 18/20/22 + 4×4 closure"; else the product title) |
| Card meta line | `custom.card_meta` | Product | **Single line text**, one value | 12–30 in · Body wave | The line under the product name on cards, instead of the one Tress writes from your options (chapter 2) |

Two more metafields are filled in by review apps, not by you: `reviews.rating` and `reviews.rating_count` give the stars on cards and "4.9 · 186 reviews" in the **Product metadata** block. And a **Spec row** block (chapter 11) can show any other product metafield you create, such as `custom.band` ("Cotton band") for lashes.

These product tags add badges (capitals don't matter):

| Tag | What it does |
| --- | --- |
| `best-seller` | A **Best seller** badge on the product's card |
| `new` | A **New** badge, whatever the product's age. Without the tag, products get it for **Theme settings › Product cards › Show New for products added in the last** days (21) after they're added. |
| `most-loved` | A **Most loved** badge (rename it with **Most loved badge label**) |

## Step 1: create the product metafield definitions

In admin, go to **Settings › Custom data › Products** and click **Add definition** for each metafield 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 above. Shopify suggests `custom.` plus the name, so "Lace" gives `custom.lace`, but "Weight per bundle" would give `custom.weight_per_bundle` and "Can be coloured" `custom.can_be_coloured`, which the theme won't find. Keys are case-sensitive.
3. Click **Select type** and choose the type in the table:
   * **Hair origin**, **Grade**, **Lace**, **Cap size**, **Density**, **Lifespan**, **Texture**, **Short name** and **Card meta line**: **Single line text**, **One value** (not a list).
   * **Weight per bundle** and **Wears**: **Integer**, **One value**. Not **Decimal**, and not **Weight** (Shopify's measurement type): Tress expects a whole number, in grams for the weight.
   * **Colouring**: **True or false**.
   * **Care**: **Rich text**.
4. **Save**.

## Step 2: add the variant weight

Bundles are sold by length, and a 26 in bundle weighs more than a 12 in one. To give each length its own weight, go to **Settings › Custom data › Variants**, click **Add definition** and create **Weight per bundle** again with exactly the same key, `custom.weight_grams`, type **Integer**, **One value**. A variant with a weight uses it; a variant without one uses the product's. If every length weighs the same (100 g bundles), the product definition alone is enough.

## Step 3: fill in your products

Open a product in admin and scroll to **Metafields**: every product definition you created is listed there. For a variant's weight, click the variant and scroll to its **Metafields**.

* **Single line text**: type the value as you want shoppers to read it: "150%", "HD lace, 13×4, free part", "12+ months with care". Write lace sizes with a multiplication sign (13×4) and lengths as "18 in".
* **Weight per bundle** and **Wears**: the number only, such as 100 or 20.
* **Colouring**: choose True or False, or leave it empty for no row.
* **Care**: use the rich text editor's **numbered list**, one step per item, and start each step with a short sentence in **bold**. For example:
  1. **Detangle before you wash.** Wide-tooth comb, from the ends up.
  2. **Wash cool, condition well.** Sulphate-free shampoo every 7 to 10 days.
  3. **Sleep in silk.** Wrap it in the bonnet we send with every install.

  A numbered list shows each step in a numbered capsule, with the bold sentence as its title line.

To fill many products at once, use **Bulk edit** from the products list and add the metafield columns. Add the `best-seller`, `new` and `most-loved` tags in the product's **Tags** field.

## The settings the features read

Everything below is in **Theme settings › Hair, lashes and nails**. Option names are matched without regard to capitals or the spaces around them, separated by commas. An option is only turned into a scale or chips when **every** value fits, so check your values if an option still shows as tiles.

| Setting | Default | Format | Used by |
| --- | --- | --- | --- |
| **Length option names** | Length, Hair length | Option names, separated by commas. Their values must be lengths: numbers in inches or cm, like 18 in or 45 cm. | The length scale (chapter 8), the card meta line, the install builder's lengths, and the Length filter's "18 in · 46 cm" list |
| **Length landmarks** | Six lines, 10 in: Chin to 30 in: Hip (below) | One per line: a length, a colon, then where it falls | The landmark beside a matching stop on the length scale, the figure's marks, the Length guide section |
| **Show the figure beside the length scale** | On | | The line-drawn figure beside the scale (the Variant picker block can override it) |
| **Length chart page** | Empty | A page | The "Length chart" link beside the length scale, the header's utility link when its own link is empty, and the Length guide section's button. Use the template `page.length-guide`. |
| **Texture option names** | Texture, Pattern | Option names, separated by commas | Texture chips (chapter 8), the card meta line, the install builder's closure preselect, and the Texture filter's mini capsules |
| **Texture images** | Empty | One per line: a texture, a colon, then a file name from Content › Files (below) | Texture chips, the install builder, the Texture filter and the mega menu's texture row, when a value has no Shopify swatch |
| **Draw the texture when there's no image** | On | | The drawn texture (seven fine strands: straight, body wave, deep wave, water wave or coils) for a texture with no picture |
| **Options with a glossary** | Lace, Density, Grade, Cap size | Option names, separated by commas | The (i) button and glossary dialog (chapter 8) |
| **Glossary** | Eleven definitions (below) | One per line: a term, a colon, then a short definition | The glossary dialog |
| **Full glossary page** | Empty | A page | "Read the full hair glossary" at the foot of the glossary dialog |
| **Cap size option names** | Cap size | Option names, separated by commas | "Find your cap size" beside that option, the Care card's wig row, and the cap guide's **Choose** button (chapter 11) |
| **Cap size table** | Small, Medium and Large (below) | One size per line: the size, a bar, then the head circumference range | The wig cap guide |
| **Nail shape option names** | Shape, Nail shape | Option names, separated by commas | Drawn nail shape chips (chapter 10) |
| **Nail length option names** | Nail length | Option names, separated by commas. Not Length: that name belongs to hair lengths. | Drawn nail length chips |
| **Nail size option names** | Size | Option names, separated by commas | Size tiles with the tip numbers and the custom panel, on press-on sets only |
| **Custom size value** | Custom | One value | The size value that asks for ten custom sizes |
| **Tip numbers per size** | XS to XL (below) | One per line: a size, a colon, then five tip numbers, thumb to pinky, separated by commas | The "Tips in size M, the same on both hands" card under the size tiles |
| **Tip widths** | Sizes 0 to 11, 18 mm to 7 mm (below) | One per line: a tip number, a colon, then its width | The table in "How to measure your nails" |
| **Sizing kit product** | Empty | A product | The "Not sure of your size?" row with **Add kit** under the size option (chapter 10) |
| **Sizing kit note** | "Try every size at home" | Text | The line beside the kit's price in that row |
| **Remember custom sizes on the shopper's device** | On | | Offers a shopper's last custom sizes back to them next time (saved in their browser only) |
| **Build your install page** | Empty | A link | **Edit install** on an install in the bag (chapter 12) |

### Length landmarks

The default:

```
10 in: Chin
14 in: Shoulder
18 in: Armpit
22 in: Mid-back
26 in: Waist
30 in: Hip
```

A stop on the length scale whose length equals a landmark's shows its name beside it ("18 in · 46 cm · Armpit"). You can write a landmark in cm (`35 cm: Shoulder`); it's matched by its length in inches, rounded. The **first six** lines also place the six marks on the figure, in order: chin, shoulder, armpit, mid-back, waist and hip. So keep six lines, in order from shortest to longest, and change the numbers to where those points fall for your hair (on a taller model, `16 in: Shoulder`). Add more lines after the sixth for extra names on the scale (`40 in: Knee`); they don't move the figure. Blank lines and lines without a colon are skipped.

### Texture images

```
Straight: straight-swatch.jpg
Body wave: body-wave-swatch.jpg
Deep wave: deep-wave-swatch.jpg
Kinky curly: kinky-curly-swatch.jpg
```

Upload each picture in **Content › Files** (a close-up of the hair, upright, works best: the chip is a tall capsule), then type the file's name exactly as Files shows it, extension included, after the texture's name. The texture's name is matched to your option value without regard to capitals: an exact match first, then the longest name the value contains, so "Body wave" also covers a value called "Body wave 100% raw". A Shopify swatch image on the option value (below) wins over this list.

### Glossary

The default:

```
HD lace: A thin, fine lace that melts into most skin tones. Handle it gently.
Transparent lace: A sturdier, see-through lace for light to medium skin tones.
Swiss lace: A soft, durable light-brown lace that outlasts HD lace.
130%: Natural fullness, like most people's own hair.
150%: Fuller than natural, the most asked-for glam finish.
180%: Extra full, for big volume and long lengths.
10A: Hair from one donor, cuticles aligned and never chemically processed.
Raw: Unprocessed hair cut from one donor, cuticles intact.
Small: Fits a head of 52 to 54.5 cm around.
Medium: Fits 55 to 57 cm around, the most common cap size.
Large: Fits 57.5 to 60 cm around.
```

Each term is matched to the values of the options in **Options with a glossary**, the same way as texture names: exactly first, then the longest term the value contains ("HD lace 13×4" finds "HD lace"). The glossary dialog lists only the option's values that have a definition, in the option's order. Write one short, plain sentence per term, and only claims that are true of your hair.

### Cap size table

The default:

```
Small | 52–54.5 cm
Medium | 55–57 cm
Large | 57.5–60 cm
```

One size per line, a bar (`|`) between the size and the range. Write the range with an en dash or a hyphen (`55-57 cm` works too), in cm or in (`21.5–22.5 in`). Name the sizes exactly as the values of your Cap size option ("Medium", not "M"), so the cap guide's **Choose Medium** button can pick the matching value.

### Tip numbers per size

The default:

```
XS: 5,8,7,8,10
S: 4,7,6,7,9
M: 3,6,5,6,9
L: 2,5,4,5,8
XL: 1,4,3,4,7
```

One line per standard size: the size exactly as it appears in your Size option, a colon, then **five** tip numbers from thumb to pinky, separated by commas. A line with more or fewer than five numbers is ignored, and a size with no line shows no tips card.

### Tip widths

The default lists sizes 0 to 11, from 18 mm down to 7 mm, one per line:

```
0: 18 mm
1: 17 mm
2: 16 mm
3: 15 mm
...
11: 7 mm
```

They show in the measuring guide as "Size 3 · 15 mm", in two columns. Use the widths of the tips you actually ship.

## Texture swatches from Shopify

Instead of (or as well as) the **Texture images** list, you can give each value of your texture option a **Shopify swatch image**: Tress uses it first, on the product page and in the Texture filter. (The install builder's texture chips are labelled by product, not by option value, so they use the **Texture images** list or the drawn texture, else the bundle's own photo.) Shopify swatches come from connecting an option to a **category metafield** that supports swatches, such as **Color**:

1. Give the product a **Category** in admin that offers the attribute.
2. In the product's **Variants** section, edit the texture option and connect it to that category metafield, choosing or creating an entry for each value (Straight, Body wave and so on).
3. Open each entry (from the option, or under **Content › Metaobjects**) and add a swatch **image** of the texture.

Keep the option's name, as the product shows it, in **Texture option names**: if connecting renames the option (to "Color", say), add that name to the list, or the chips won't appear. A value with only a swatch color and no image falls through to the Texture images list, then to the drawn texture.

## The install builder's settings

The install builder reads its own section's settings, not metafields (chapter 9 has them all). The ones to set before it can sell:

* **Bundles**: a collection with **one product per texture**, each with a **Length** option (named in **Length option names**). The first 8 products are shown, as texture chips labelled with each product's `custom.texture` (else its title).
* **Closures and frontals**: optional, a collection of your closures and frontals. The first 4 are shown.
* **Most bundles** (4, 2 to 6) and **Fewest bundles** (2, 1 to 4): how many bundles one install can hold.
* **Deal line** ("3 bundles and a closure: 15% off at checkout"), **Bundles for the deal** (3, 0 to 6; 0 hides the line) and **Deal needs a closure or frontal** (on): when the deal line counts as met.
* Each bundle variant's (or product's) `custom.weight_grams`, for the total weight, and each closure's `custom.short_name`, for the install's label.

**The deal line is only words.** You create the discount itself in Shopify admin as an **automatic discount**, so it applies at checkout without a code:

1. Go to **Discounts › Create discount** and choose **Amount off products**.
2. Set **Method** to **Automatic discount** and give it a **Title** shoppers will see at checkout ("Install deal").
3. Set the **Value** to a **Percentage** (15) and **Applies to** to **Specific collections**: your Bundles and Closures and frontals collections.
4. Under **Minimum purchase requirements**, choose **Minimum quantity of items** and type 4 (three bundles and a closure).
5. Set the dates and **Save**.

Shopify applies the discount by its own rules: this one also takes 15% off four bundles without a closure, because it counts items, not what they are. Word the deal line to match the discount you actually create, and set the same deal line in the **Cart drawer** and **Cart** sections (chapter 12), which show it again in the bag.

## The sizing kit product

Create your sizing kit as an ordinary product (Lacquer's home page promotes one with 12 clear tips in sizes 0 to 11), then choose it in **Theme settings › Hair, lashes and nails › Sizing kit product**. Every press-on set's size option then gets a "Not sure of your size?" row with the kit's photo, title, price and **Sizing kit note**, and an **Add kit** button that puts it in the bag without leaving the page. A kit with options links to its own page instead. Leave the setting empty for no row; the "How to measure your nails" link stays either way.

## The instalments message

The **Price** block's **Show Shop Pay Installments** (on) prints Shopify's own instalments message under the price, with Shopify's "Learn more" link. It appears only when **Shop Pay Installments** is enabled on your store (in **Settings › Payments**, where Shopify offers it); there is nothing to set up in the theme. Tress never prints a "pay in 4" line of its own: the presets' "Pay in 4 available" announcement and "Pay in 4 at checkout" hero tick are demo words, so keep them only if you offer a pay-later method at checkout.

## What shows without the data

| Missing | What happens |
| --- | --- |
| All the hair metafields | No hair rows or stat pills. A product with variants still gets a Hair details panel listing its chosen options while the block's **Show variant options** is on (the default); turn it off, and a product with no hair data and no Spec rows shows no panel, and the Care card spans the width. |
| One hair metafield | That row (or stat pill) is skipped |
| `custom.weight_grams` on a bundle or closure | The install builder leaves the total weight out of its summary |
| `custom.care` | The Care block's own **Care steps**; with those cleared too, no Care card |
| `custom.texture` | The install builder labels the texture with the product title |
| `custom.short_name` | The install's label uses the closure's product title |
| `custom.card_meta` | Tress writes the card's meta line from your options |
| Length landmarks | Stops show no landmark names; with fewer than two lines, the figure places the hair by the stop's position in the list |
| Texture images, swatches and drawable names | The texture option shows as plain tiles |
| A glossary definition for any of an option's values | No (i) button for that option |
| Tip numbers for a size | No tips card for that size |
| Sizing kit product | No kit row |

In the theme editor, features with no data show a sample tagged **Sample** so you can see the design: sample rows and pills in Hair details, the sample length scale, texture chips, lace glossary and nail sizer in the variant picker (chapter 6), and four drawn textures with working steppers in the install builder. Shoppers never see them.

> **Note:** Text you type into a block on the product template (the Care block's **Care steps**, the Trust rows, a Spec row's **Value**) shows on **every product that uses this template**. Use it for what's true of every product, or on a template you make for a group of products (in the theme editor, **Create template** from the product template and assign it to those products in admin). For anything that differs per product, use the metafields.
