سؤال

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?

هل كانت مفيدة؟

المحلول

Try:

{% for discount in discounts %}
   {% if discount.code = "testcoupon123" %} 
      You will get a free item!
   {% endif %}
{% endfor %}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top