" product.tags"在shopify购物车

时间:2015-08-05 16:05:46

标签: shopify

我希望在"谢谢你"的HTML中显示一个特定的图像(带有出站链接)。我的Shopify商店的页面。如果购物车中有任何带有特定标签(stb)的产品,我希望它显示

{% for product in cart.items.products %}
{% assign product_tags_string = product.tags | join ' ' %}
{% if product_tags_string contains 'stb' %}
<p><a href="http://www.sharethebus.com" target="_blank" title="Book your bus ticket here"><img src="//cdn.shopify.com/s/files/1/0256/7469/files/FB_Meals_Token_large.png?11171876204102072109" /></a>
</p>
{% endif %}
{% endfor %}

1 个答案:

答案 0 :(得分:1)

试试这个:

{% for item in cart.items %}
{% assign product_tags_string = item.product.tags | join ' ' %}
...
{% endfor %}