Display discount codes in new order notification email

Solved
Highlighted
New Member
2 1 0

I want to display discount codes in new order email notification template, using this code:

 

{% for discount in discounts %}
      {{ discount.code }} : {{ discount.savings | money_with_currency }}
{% endfor %}

 

It's displaying the discount amount but not the discount code name/title. It's returning blank even if the discount is manually entered in the back-end when creating an order.

 

How can I display discount codes no matter where it's entered i.e in admin or checkout?

0 Likes
Highlighted
New Member
2 1 0

This is an accepted solution.

Was able to solve it with the below code:

 

{% for discount_application in discount_applications %}
	{{ discount_application.title }} : -{{ discount_application.total_allocated_amount | money_with_currency }}
{% endfor %}
0 Likes