日本語
Miyabi のいくつかのブロックとセクションは、商品のメタフィールドに入れた情報を読みます。メタフィールドは、管理画面の「設定 > メタフィールドとメタオブジェクト」で定義を作り、商品の編集画面の下にある「メタフィールド」欄に入れます。使わない項目は作らなくてかまいません。
- 定義の名前は自由です。名前を入れると「ネームスペースとキー」の欄が出るので(custom. で始まる欄)、下の表のとおりにします
- 「既定」と書いたキーは、ブロックやセクションの設定(「商品のメタフィールド」など)で別のキーに変えられます
- タイプは、タイプを選ぶ画面で名前を検索すると見つかります
写真ごとの着用モデルの身長とサイズ
商品の写真ごとに、モデルの身長と着用サイズを写真の左下に出します(例: モデル身長 168cm / Sサイズ着用)。メタオブジェクトの定義と、商品のメタフィールドの定義の2つを作ります。
1. メタオブジェクトの定義を作る
- 「設定 > メタフィールドとメタオブジェクト」の「メタオブジェクト定義」で「定義を追加」を押す
- 名前を入れ(例: Model shot)、名前の下に出るタイプを
model_shotにする(タイプは名前から自動で入ります) - 「フィールドを追加」で、次の3つのフィールドを作る。名前は自由ですが、キーは下の表のとおりにします
- 保存する。「メタオブジェクトのオプション」の「ストアフロントAPIへのアクセス」は、オフのままでかまいません(テーマの表示には使いません。商品のメタフィールドの定義に「ストアフロントでは…アクセスできません」と出ても、写真には表示されます)。「アクティブ/下書きステータス」をオンにした場合は、エントリーを「アクティブ」にしてください。下書きのエントリーはお店に出ません
| キー | タイプ | 入れる内容 |
|---|---|---|
image |
ファイル | モデルが写っている商品の写真 |
height |
単一行テキスト | モデルの身長を数字だけ(例: 168。「cm」は自動で付きます) |
size |
単一行テキスト | 着用サイズ(例: M) |
2. 商品のメタフィールドの定義を作る
- 「設定 > メタフィールドとメタオブジェクト」の「メタフィールドの定義」で「商品」を開き、「定義を追加する」を押す
- 名前を入れ(例: 着用モデルの写真)、ネームスペースとキーを
custom.model_shotsにする - タイプの左の「1つ」を「リスト」に切り替え(複数入れられる形)、タイプに「メタオブジェクト」を選んで、1で作った定義を選ぶ
- 保存する
3. 商品に入れる
- 商品の編集画面の「メタフィールド」欄で、2で作った項目を押し、「新しいエントリーを追加」を選ぶ
imageに写真を選ぶ。その商品に登録してある写真そのもの(「コンテンツ > ファイル」にある同じ画像)を選びます。同じ写真でも、別に上げ直したものでは表示されませんheightとsizeを入れて保存する。写真ごとに繰り返します- テーマエディターの「商品情報」セクションで、「画像に着用モデルの身長とサイズを出す」がオン(初期値)であることを確かめる
そのほかの項目
| 使うところ | ネームスペースとキー | タイプ | 入れる内容 |
|---|---|---|---|
| 予約の案内(購入ボタンの下) | custom.preorder_note |
単一行テキスト | 例: 11月中旬より順次お届けします。在庫切れでも販売を続ける設定のバリエーションで、在庫が0以下のときに出ます |
| 予約の締め切り(テンプレート「preorder」のカウントダウン) | custom.preorder_end(既定) |
日時 | 予約を締め切る日時 |
| セールの終わり(カウントダウン) | custom.sale_end(既定) |
日時 | セールが終わる日時 |
| サイズガイド(商品ごと) | custom.size_guide |
ページ・リッチテキスト・複数行テキストのどれか | ページを選ぶか、表や文を入れる。「バリエーションの選択」で選んだページの代わりに出ます |
| 色違いの商品 | custom.siblings(既定) |
商品(「リスト」に切り替える) | 色ごとに分けた商品をすべて。その商品自身もリストに入れます |
| 着用モデル(文字) | custom.model_info(既定) |
複数行テキスト | 1行に1人(例: 身長 168cm・S サイズ着用) |
| サイズ感 | custom.fit(既定) |
整数 | 1(小さめ)〜5(大きめ) |
| アップセル | custom.upsell(既定) |
商品 | この商品と一緒に買ってほしい商品 |
| サイズ表(「サイズ表」セクション) | custom.size_table(既定) |
複数行テキスト | 1行目が見出し。セルはカンマかタブで区切る(例: サイズ, 着丈, 身幅) |
| スペック表 | custom.specs(既定) |
複数行テキスト | 「項目: 内容」を1行ずつ(例: 重さ: 48g)。コロンの無い行はグループの見出し |
| 対応機種 | custom.compatibility(既定) |
単一行テキスト(「リスト」に切り替える)か複数行テキスト | 1行に1機種 |
| 保証 | custom.warranty(既定) |
単一行テキスト・複数行テキスト・リッチテキストのどれか | 保証の文章 |
| 取扱説明書 | custom.manual(既定) |
ファイルか URL | PDF のファイルか、説明書のページの URL |
比較に使う項目
- 商品カードの比較(テーマ設定の「比較する項目」)と「比較表」セクションの行には、好きなメタフィールドを使えます(例: 重さ | custom.weight)
- 単一行テキスト・複数行テキスト・整数・小数・真または偽が向いています。真または偽は、チェックの印かダッシュで出ます
星の評価
- 星は、Shopify の標準のレビュー情報(
reviews.ratingとreviews.rating_count)を読みます。この2つはレビューアプリが入れるもので、ご自身で定義を作る必要はありません(「10. アプリとの連携」)
English
Some of Miyabi's blocks and sections read details that you add to products as metafields. Create the definitions in Settings > Metafields and metaobjects in your Shopify admin, then enter the values in the Metafields section at the bottom of each product's page. You only need the ones you use.
- You can give each definition any name. After you enter the name, a Namespace and key field appears (it starts with custom.). Set it exactly as shown below
- Keys marked default can be changed in the block or section settings (such as Product metafield)
- To find a type, search for its name where you select the type
Model height and size on each photo
Shows the model's height and the size worn at the lower left of each product photo (for example, Model 168 cm / wearing size S). You create two definitions: a metaobject definition and a product metafield definition.
1. Create the metaobject definition
- In Settings > Metafields and metaobjects, click Add definition under Metaobject definitions.
- Enter a name (for example, Model shot) and make sure the type shown under the name is
model_shot(it's filled in from the name). - Click Add field and create the three fields below. The names are up to you, but the keys must match the table.
- Save. You can leave Storefront API access off under the metaobject options. The theme doesn't use it, and the labels still show on photos even if the product metafield definition warns that storefronts can't access the metaobject. If you turn on Active/draft status, set entries to Active. Draft entries don't appear in your store.
| Key | Type | What to enter |
|---|---|---|
image |
File | The product photo that shows the model |
height |
Single line text | The model's height as a number only (for example, 168; cm is added for you) |
size |
Single line text | The size worn (for example, M) |
2. Create the product metafield definition
- In Settings > Metafields and metaobjects, open Products under Metafield definitions and click Add definition.
- Enter a name (for example, Model shots) and set Namespace and key to
custom.model_shots. - Next to the type, switch from one value to a list (so it holds more than one entry), choose Metaobject as the type, and select the definition from step 1.
- Save.
3. Add entries to a product
- In the Metafields section of the product's page, click the field from step 2 and add a new entry.
- For
image, choose the photo. Choose the same image that's on the product (the same file in Content > Files). A copy of the photo uploaded again won't match. - Enter
heightandsize, and save. Repeat for each photo. - In the theme editor, check that Show model height and size on images is on in the Product information section (it's on by default).
Other fields
| Used for | Namespace and key | Type | What to enter |
|---|---|---|---|
| Pre-order note (below the buy button) | custom.preorder_note |
Single line text | For example, Ships from mid-November. It appears for variants that continue selling when out of stock, once stock is at or below zero |
| End of pre-orders (the countdown in the preorder template) | custom.preorder_end (default) |
Date and time | When pre-orders close |
| End of a sale (countdown) | custom.sale_end (default) |
Date and time | When the sale ends |
| Size guide for one product | custom.size_guide |
Page, rich text, or multi-line text | Choose a page, or enter a table or text. It replaces the page chosen in the Variant picker block |
| Other colors | custom.siblings (default) |
Product (list) | All the products sold as separate colors, including the product itself |
| Model information (text) | custom.model_info (default) |
Multi-line text | One model per line (for example, 168 cm, wearing size S) |
| Fit scale | custom.fit (default) |
Integer | 1 (runs small) to 5 (runs large) |
| Upsell product | custom.upsell (default) |
Product | The product to offer with this one |
| Size chart (Size chart section) | custom.size_table (default) |
Multi-line text | The first line is the heading. Separate cells with commas or tabs (for example, Size, Length, Chest) |
| Specifications | custom.specs (default) |
Multi-line text | One Name: Value per line (for example, Weight: 48 g). A line without a colon starts a group |
| Compatible models | custom.compatibility (default) |
Single line text (list) or multi-line text | One model per line |
| Warranty | custom.warranty (default) |
Single line text, multi-line text, or rich text | Your warranty text |
| Instruction manual | custom.manual (default) |
File or URL | A PDF file, or the URL of the manual's page |
Fields for comparisons
- Rows in product card comparisons (Comparison rows in theme settings) and in the Comparison table section can use any metafield (for example, Weight | custom.weight)
- Single line text, multi-line text, integer, decimal, and true or false work best. True or false shows as a check mark or a dash
Star ratings
- Stars read Shopify's standard review metafields (
reviews.ratingandreviews.rating_count). Review apps fill these in, so you don't need to create definitions for them (see 10. Working with apps)