Bỏ qua, tới nội dung

Thiết lập Apparel

Một số section của Apparel đọ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.

Tên kiểu dữ liệu và phần mô tả được giữ nguyên tiếng Anh, đúng như Shopify admin gọi chúng khi để tiếng Anh. Ở ngôn ngữ khác, bạn sẽ thấy cùng các kiểu đó dưới tên đã dịch trong Settings → Custom data.

Làm theo thứ tự này

  1. 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.
  2. 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.
  3. Điền giá trị cho từng sản phẩm, ở khung Metafields cuối trang sản phẩm trong Shopify admin.
  4. 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ộc
  • answerRich textrich_text_fieldBắt buộc

Testimonial testimonial

A quote, for Testimonials set to read entries.

  • quoteMulti-line textmulti_line_text_fieldBắt buộc
  • authorSingle line textsingle_line_text_fieldKhông bắt buộc
  • detailSingle line textsingle_line_text_fieldKhông bắt buộc
  • imageFilefile_referenceKhông bắt buộc
  • sourceSingle 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ộc
  • linkURLurlKhô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ộc
  • iconSingle line textsingle_line_text_fieldKhông bắt buộc
  • imageFilefile_referenceKhông bắt buộc
  • textMulti-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ẩm

    Single line text single_line_text_field

    The drop's number — 014 — on the release board, the hero, the card and the product page.

  • hullara.drop_opens_atTrên sản phẩm

    Date and time date_time

    When 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ẩm

    True or false boolean

    Marks a drop that comes back, so the board says "Restock" rather than a new number.

  • hullara.accentTrên sản phẩm

    Color color

    The product's own color, behind its card or a bento tile when those settings ask for it.

  • hullara.colourwaysTrên sản phẩm

    Product (list of products) list.product_reference

    The other colors of a product, when each color is a product of its own; Colorways links them.

  • hullara.colourwayTrên sản phẩm

    Single line text single_line_text_field

    This product's own color name in that list.

  • hullara.badgeTrên sản phẩm

    Single line text single_line_text_field

    A 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ẩm

    Date date

    A pre-order date: the delivery estimate counts from it rather than from today.

  • custom.fitTrên sản phẩm

    Integer number_integer

    Where 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_field

    How 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)

Cho phép chúng tôi đếm lượt xem trang này bằng Google Analytics chứ? Bấm từ chối thì không có gì bạn nhìn thấy thay đổi, và chúng tôi vẫn biết trang này được đọc — chỉ là không biết người đọc là bạn. Không có cookie quảng cáo trong cả hai trường hợp. Chính xác thì chúng tôi lưu gì