Php Shopify-折扣代码的条件
我想知道,当用户将优惠券应用到购物车时,是否可以向用户打印一条消息,如下所示:Php Shopify-折扣代码的条件,php,variables,shopify,liquid,Php,Variables,Shopify,Liquid,我想知道,当用户将优惠券应用到购物车时,是否可以向用户打印一条消息,如下所示: {% if discount = testcoupon123 %} You will get a free item! {% endif %} 有人能告诉我为什么这不起作用吗?试试: {% for discount in discounts %} {% if discount.code = "testcoupon123" %} You will get a free item! {% e
{% if discount = testcoupon123 %}
You will get a free item!
{% endif %}
有人能告诉我为什么这不起作用吗?试试:
{% for discount in discounts %}
{% if discount.code = "testcoupon123" %}
You will get a free item!
{% endif %}
{% endfor %}
尝试
{%if折扣='testcoupon123%}