Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Display discount in order confirmation e-mail

Anna Siwikdac6dba477a3
diff --git a/templates/dashboard/order/fulfillment.html b/templates/dashboard/order/fulfillment.html
index 6b6a51d282..79beebd350 100644
--- a/templates/dashboard/order/fulfillment.html
+++ b/templates/dashboard/order/fulfillment.html
@@ -7,7 +7,6 @@
{% load status %}
{% load staticfiles %}
{% load dashboard %}
-{% load discount_amount_for from prices %}
{% block title %}
{% trans "Fulfill" context "Dashboard order fulfillment" %} {{ order }} - {% trans "Orders" context "Dashboard orders list" %} - {{ block.super }}
diff --git a/templates/templated_email/source/order/confirm_order.email b/templates/templated_email/source/order/confirm_order.email
index 449844c66f..72fa40ef83 100644
--- a/templates/templated_email/source/order/confirm_order.email
+++ b/templates/templated_email/source/order/confirm_order.email
@@ -1,5 +1,6 @@
{% load i18n %}
{% load prices_i18n %}
+{% load voucher %}
{% block subject %}
{% trans "Order details" context "Order confirmation e-mail subject" %}
@@ -17,6 +18,7 @@ Thank you for your order. Below is the list of ordered products. To see your pay
{% trans "Order summary" context "Order confirmation e-mail table header" %}:
{% trans "Subtotal" context "Order confirmation e-mail table header" %}: {{ order.get_subtotal.gross|amount }}
{% trans "Shipping" context "Order confirmation e-mail table header" %}: {{ order.shipping_price.gross|amount }}
+{% if order.discount_amount %}{% trans "Discount:" context "Order confirmation e-mail table header" %} {% discount_as_negative order.discount_amount %}{% endif %}
{% trans "Total" context "Order confirmation e-mail table header" %}: {{ order.total.gross|amount }}
{% trans "Billing address" context "Order confirmation e-mail billing address" %}
diff --git a/templates/templated_email/source/order/partials/_order_lines.mjml b/templates/templated_email/source/order/partials/_order_lines.mjml
index ae1ea1de3e..0af686f3b4 100644
--- a/templates/templated_email/source/order/partials/_order_lines.mjml
+++ b/templates/templated_email/source/order/partials/_order_lines.mjml
@@ -2,6 +2,7 @@
<mj-column>
<mj-text>
{% load prices_i18n %}
+ {% load voucher %}
</mj-text>
</mj-column>
</mj-section>
@@ -25,6 +26,16 @@
{{ order.shipping_price.gross|amount:'html' }}
</td>
</tr>
+ {% if order.discount_amount %}
+ <tr>
+ <td colspan="3" style="text-align: right;">
+ {% trans "Discount" context "E-mail order lines summary table" %}
+ </td>
+ <td style="text-align: right;">
+ {% discount_as_negative order.discount_amount html=True %}
+ </td>
+ </tr>
+ {% endif %}
<tr>
<td colspan="3" style="text-align: right;">
<strong>{% trans "Total" context "E-mail order lines summary table" %}</strong>