Skip to content

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

Conditionally display order's shipping_address in e-mails

Anna Siwik8c7b0021f821
diff --git a/templates/templated_email/html/order/confirm_order.html b/templates/templated_email/html/order/confirm_order.html
index 21de3d2e26..5583d9246e 100644
--- a/templates/templated_email/html/order/confirm_order.html
+++ b/templates/templated_email/html/order/confirm_order.html
@@ -25,7 +25,7 @@
</td>
<td>
{% trans "Shipping address" context "Order confirmation e-mail shipping address" %}
- <br>{% format_address order.shipping_address %}
+ <br>{% if order.shipping_address %}{% format_address order.shipping_address %}{% endif %}
</td>
</tr>
<tr>
diff --git a/templates/templated_email/order/confirm_order.email b/templates/templated_email/order/confirm_order.email
index c43ea03ec5..101bb29fd5 100644
--- a/templates/templated_email/order/confirm_order.email
+++ b/templates/templated_email/order/confirm_order.email
@@ -22,8 +22,8 @@ Thank you for your order. Below is the list of ordered products. To see your pay
{% trans "Billing address" context "Order confirmation e-mail billing address" %}
{{ order.billing_address }}
-{% trans "Shipping address" context "Order confirmation e-mail shipping address" %}
-{{ order.shipping_address }}
+{% if order.shipping_address %}{% trans "Shipping address" context "Order confirmation e-mail shipping address" %}
+{{ order.shipping_address }}{% endif %}
{% blocktrans context "Order confirmation email text" %}
This is an automatically generated email, please do not reply.