跳转到内容
免费试用 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 元字段中的自定义数据来定位产品,即您为产品或多属性定义的任何自定义属性。

在定位元字段之前,您需要先获取它的引用:

  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) 逻辑组合的两条规则。

这对您有帮助吗?