Try:
{% for discount in discounts %}
{% if discount.code = "testcoupon123" %}
You will get a free item!
{% endif %}
{% endfor %}
Domanda
I was wondering if its possible to print a message to the user when they apply a coupon to their cart, something like this:
{% if discount = testcoupon123 %}
You will get a free item!
{% endif %}
Can anyone tell me why this doesn't work please?
Soluzione
Try:
{% for discount in discounts %}
{% if discount.code = "testcoupon123" %}
You will get a free item!
{% endif %}
{% endfor %}