跳到內容
免費試用 7 天
繁體中文
在 Claude 中開啟 針對此頁面提問在 ChatGPT 中開啟 針對此頁面提問

依款式和中繼欄位指定

依商品款式、款式庫存,或您在 Shopify 中定義的中繼欄位值來指定徽章。

依款式和中繼欄位指定,讓您能最精細地控制哪些商品顯示徽章:可依商品的款式和庫存量來指定,或比對您在 Shopify 中定義的自訂中繼欄位屬性。

兩者都是徽章編輯器 Products 索引標籤中的條件類型,因此設定方式與其他商品條件相同,差別只在於您要填寫的欄位。

  • 從 Badges & Labels 開啟您要編輯的徽章,或建立新的徽章。如果不確定如何開啟編輯器,請參閱指定商品。
  • 若要使用中繼欄位指定,該中繼欄位必須已存在於 Shopify 中。請先在設定 → 自訂資料下建立,詳見尋找中繼欄位的命名空間和索引鍵。
條件 指定對象 常見選項
Select specific variants 您手動挑選的個別款式 搜尋或瀏覽 · 勾選要顯示徽章的款式
Product variants 商品是否有款式 products with variants · product has no variants
Variant inventory 個別款式的庫存量 in stock · out of stock · stock availability greater than · stock availability less than
Product metafield 在商品上定義的中繼欄位 is equal to · is not equal to · contains · does not contain · is greater than · is less than
Variant metafield 在款式上定義的中繼欄位 is equal to · is not equal to · contains · does not contain · is greater than · is less than

依款式層級而非商品層級的資料顯示徽章,適用於只有特定尺寸、顏色或配置才應觸發徽章的情況。

  1. 在徽章編輯器中,點擊左側面板頂端索引標籤列中的 Products(位於 Design 和 Display 旁邊)。

    徽章編輯器中的 Products 索引標籤

    徽章編輯器的索引標籤:Design、Products 和 Display。

  2. 在 Choose products to show this badge 下,選取 Products matching conditions。下方會出現 Conditions 卡片。

    已選取 Products matching conditions,下方顯示 Conditions 卡片

    選擇 Products matching conditions 後會顯示 Conditions 卡片。

  3. 在 Products must match 旁,選擇 all conditions (AND) 或 any condition (OR)。若只新增一條規則,請維持在 all conditions。

  4. 點擊 + Add conditions,然後從條件下拉式選單中選擇 Product variants 或 Variant inventory。

  5. 若選擇 Product variants,請選擇 products with variants 或 product has no variants。

    若選擇 Variant inventory,請選擇庫存運算子;若使用「greater than」和「less than」運算子,還需輸入庫存門檻。

    Variant inventory 條件設為 stock availability less than 3

    範例:指定庫存少於 3 件的款式。

  6. 點擊右上角的 Save。畫面會顯示 Badge/Label updated 確認訊息,規則隨即在您的商店前台生效。

中繼欄位條件會根據儲存在 Shopify 中繼欄位中的自訂資料來指定商品,也就是您為商品或款式定義的任何自訂屬性。

尋找中繼欄位的命名空間和索引鍵

Section titled “尋找中繼欄位的命名空間和索引鍵”

指定中繼欄位之前,您需要先取得它的參照:

  1. 在 Shopify 後台中,前往設定 → 自訂資料。
  2. 選取商品(若是款式中繼欄位則選取款式)。
  3. 開啟您要使用的中繼欄位定義。
  4. 複製其 namespace 和 key。應用程式要求將兩者合併為 namespace.key,例如 custom.material。

Shopify 設定、自訂資料,顯示命名空間和索引鍵的商品中繼欄位定義

命名空間和索引鍵會顯示在 Shopify 後台的中繼欄位定義頁面上。

  1. 開啟 Products 索引標籤並選取「Products matching conditions」

    Section titled “開啟 Products 索引標籤並選取「Products matching conditions」”

    與依款式指定相同:Products 索引標籤 → Products matching conditions → 選擇 all conditions 或 any condition。

  2. 點擊 + Add conditions,然後選擇 Product metafield 或 Variant metafield。

  3. 以 namespace.key 格式輸入中繼欄位的參照。例如:

    • custom.material:自訂材質中繼欄位
    • custom.certification:認證狀態中繼欄位
    • descriptors.subtitle:商品副標題中繼欄位

    已填入命名空間索引鍵欄位的 Product metafield 條件

    以 namespace.key 格式輸入中繼欄位的參照。

  4. 選擇運算子(is equal to、contains、is greater than 等),並輸入要比對的值。數字運算子只適用於儲存數字的中繼欄位。

    已設定運算子和值的中繼欄位條件

    完成的中繼欄位規則:custom.material is equal to Organic。

  5. 點擊右上角的 Save。畫面會顯示 Badge/Label updated 確認訊息。

中繼欄位 (namespace.key) 運算子 值 使用情境
custom.material is equal to Organic 在有機商品上顯示「Organic」徽章
custom.certification contains ISO 為所有通過 ISO 認證的商品加上徽章
custom.country_of_origin is equal to Italy 顯示「Made in Italy」徽章
custom.is_bestseller is equal to true 顯示「Bestseller」徽章
custom.rating is greater than 4 在高評分商品上顯示「Top Rated」徽章

款式和中繼欄位條件可以彼此合併,也可以與任何其他商品條件合併。請以 + Add conditions 逐一新增每條規則,然後將 Products must match 設為 all conditions,讓每條規則都必須成立。

  • Variant inventory stock availability less than 3 AND Product metafield custom.is_featured is equal to true
  • 結果:「Last Few Left」徽章,只會出現在款式層級庫存少於 3 件的精選商品上。

已選取 all conditions 並合併的兩個條件

以 all conditions (AND) 邏輯合併的兩條規則。

這對您有幫助嗎?