Thiết lập Drop
Một số section của Drop đọc dữ liệu bạn lưu trên sản phẩm — ngày mở bán của một đợt drop, thành phần, độ vừa. Theme không thể tự tạo cấu trúc đó cho bạn, nên trang này liệt kê mọi định nghĩa theme đọc, đúng như Shopify yêu cầu. Trang được sinh ra từ chính theme, nên không bao giờ đòi một định nghĩa mà theme không còn đọc.
Làm theo thứ tự này
- Tạo định nghĩa metaobject trước, trong Settings → Custom data → Metaobjects, với các trường liệt kê bên dưới. Các metafield sản phẩm chứa danh sách entry sẽ trỏ tới chúng.
- Tạo định nghĩa metafield trong Settings → Custom data → Products (và Variants, nếu bảng ghi vậy), với namespace và key viết đúng y như dưới đây và đúng kiểu dữ liệu.
- Điền giá trị cho từng sản phẩm, ở khung Metafields cuối trang sản phẩm trong Shopify admin.
- Mở trình sửa theme. Section đọc các metafield này sẽ hiện dữ liệu ngay; section nào vẫn chưa có gì để hiện sẽ ghi rõ nó cần gì, và chỉ hiện ghi chú đó trong trình sửa.
Các metaobject cần tạo
Type phải đúng y như dưới đây; tên thì tuỳ bạn. Hãy bật quyền truy cập storefront cho từng định nghĩa, nếu không theme sẽ không đọc được các entry.
FAQ faq
A question and its answer, for Collapsible content set to read entries.
questionSingle line textsingle_line_text_fieldBắt buộcanswerRich textrich_text_fieldBắt buộc
Testimonial testimonial
A quote, for Testimonials set to read entries.
quoteMulti-line textmulti_line_text_fieldBắt buộcauthorSingle line textsingle_line_text_fieldKhông bắt buộcdetailSingle line textsingle_line_text_fieldKhông bắt buộcimageFilefile_referenceKhông bắt buộcsourceSingle line textsingle_line_text_fieldKhông bắt buộc
Logo logo
A logo, for Logo list set to read entries.
imageFilefile_referenceBắt buộclinkURLurlKhông bắt buộc
Icon item icon_item
One promise with an icon, for Icon bar set to read entries.
headingSingle line textsingle_line_text_fieldBắt buộciconSingle line textsingle_line_text_fieldKhông bắt buộcimageFilefile_referenceKhông bắt buộctextMulti-line textmulti_line_text_fieldKhông bắt buộc
Các metafield cần tạo
Namespace và key phải đúng y như dưới đây. Hãy bật quyền truy cập storefront cho từng định nghĩa, nếu không theme sẽ không đọc được.
hullara.drop_numberTrên sản phẩmSingle line text
single_line_text_fieldThe drop's number — 014 — on the release board, the hero, the card and the product page.
hullara.drop_opens_atTrên sản phẩmDate and time
date_timeWhen the drop opens. Before it, the product reads "Opens …" with a countdown and a reminder form instead of a buy button.
hullara.restockTrên sản phẩmTrue or false
booleanMarks a drop that comes back, so the board says "Restock" rather than a new number.
hullara.accentTrên sản phẩmColor
colorThe product's own color, behind its card or a bento tile when those settings ask for it.
hullara.colourwaysTrên sản phẩmProduct (list of products)
list.product_referenceThe other colors of a product, when each color is a product of its own; Colorways links them.
hullara.colourwayTrên sản phẩmSingle line text
single_line_text_fieldThis product's own color name in that list.
hullara.badgeTrên sản phẩmSingle line text
single_line_text_fieldA word on the product's card — Organic, New — in every language: translate it in Translate & Adapt. A badge:Organic tag reads the same in every language, because Shopify does not translate tags.
hullara.ships_onTrên sản phẩmDate
dateA pre-order date: the delivery estimate counts from it rather than from today.
hullara.kitTrên sản phẩmProduct (list of products)
list.product_referenceThe pieces sold with this product, which the product page's bundle offers by default.
custom.fitTrên sản phẩmInteger
number_integerWhere the product sits on the fit scale, from -2 (runs small) to 2 (runs large).
custom.lastsTrên biến thểSingle line text
single_line_text_fieldHow long the chosen size lasts — "about six months" — under the size buttons.
Do ứng dụng ghi
Những metafield này bạn không phải tạo: ứng dụng được nêu tên sẽ điền chúng, và theme đọc khi có dữ liệu.
reviews.rating— Stars on the product page and in testimonials. (a reviews app)reviews.rating_count— How many reviews the stars stand for. (a reviews app)shopify--discovery--product_recommendation.complementary_products— The products a bundle or "Pairs well with" offers when set to complementary. (the Search & Discovery app)