Shopify-如何输出特定客户';是否使用if?

Shopify-如何输出特定客户';是否使用if?,shopify,product,liquid,customer,Shopify,Product,Liquid,Customer,我为客户保留了一个元字段。 customer.metafields.reserved.stuff 如果product.tags包含“X”,我需要在.product-card-list.liquid中“输出”特定客户的元字段(“reserved.stuff”)。 大概是这样的: {% if product.tags contains "reservedforTom"} {{ customerID.customer.metafields.reserved.stuff }} {% endif %}

我为客户保留了一个元字段。 customer.metafields.reserved.stuff

如果product.tags包含“X”,我需要在.product-card-list.liquid中“输出”特定客户的元字段(“reserved.stuff”)。 大概是这样的:

{% if product.tags contains "reservedforTom"}
{{ customerID.customer.metafields.reserved.stuff }}
{% endif %}

如何根据客户的customer.id在产品卡列表中输出特定客户的元字段?

如果客户已登录,则您有一个客户。所以你可以检查一下

customer.id
或者,您可以检查是否存在任何元字段

customer.metafields

看来出于您的目的,您可以跳过与ID有关的任何内容,因为它在这方面不起任何作用。登录的客户有或没有元字段

有些事情需要澄清才能回答您的问题:“reservedforTom”=>这是否意味着标签内容基于{{customer.first_name}}?{{customer.id}=>customer.id变量是元字段的名称空间、键还是值的一部分?