首页 > 解决方案 > Add specific tags to specifi products in a shopify

问题描述

I have a question as i have been searching this and found nowhere the required answer, can you please help me to find a way to add / assign tag to a product through liquid? I mean i want to give some specific products some specific tags, as there are thousands of products in a store and doing it manually will take days to add the tags, i want something like this

{% if product.price >1 or <75 %}
{% assign tag="less-than-75" %}
{% else %}
{% assign tag="above75" %}
{% endif %}

Please ignore the coding error as i am totally new to the shopify liquid Thanks in advance Any help will be appreciated

标签: tagsshopifyliquid

解决方案


您不能以任何方式通过液体向产品添加标签。

您可以使用 REST api 并通过您选择的语言(js/php/python 等)更新产品https://help.shopify.com/en/api/reference/products/product#update ,但不能使用液体.

液态语言是为了从后端输出前端的信息,而不是为了修改后端的信息。


推荐阅读