Skip to content

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

Properly display cart total in local currency

Mira Szewczyk7ecf64706cee
diff --git a/saleor/cart/utils.py b/saleor/cart/utils.py
index e7e6dae1c2..b85591ed21 100644
--- a/saleor/cart/utils.py
+++ b/saleor/cart/utils.py
@@ -221,6 +221,7 @@ def get_cart_data(cart, shipping_range, currency, discounts):
local_cart_total = None
shipping_required = False
total_with_shipment = None
+ local_total_with_shipment = None
if cart:
cart_total = cart.get_total(discounts=discounts)
local_cart_total = to_local_currency(cart_total, currency)
@@ -228,9 +229,12 @@ def get_cart_data(cart, shipping_range, currency, discounts):
total_with_shipment = PriceRange(cart_total)
if shipping_required and shipping_range:
total_with_shipment = shipping_range + cart_total
+ local_total_with_shipment = to_local_currency(
+ total_with_shipment, currency)
return {
'cart_total': cart_total,
'local_cart_total': local_cart_total,
'shipping_required': shipping_required,
- 'total_with_shipment': total_with_shipment}
+ 'total_with_shipment': total_with_shipment,
+ 'local_total_with_shipment': local_total_with_shipment}
diff --git a/templates/cart/_subtotal_table.html b/templates/cart/_subtotal_table.html
index ac4e820970..4608a18e63 100644
--- a/templates/cart/_subtotal_table.html
+++ b/templates/cart/_subtotal_table.html
@@ -54,11 +54,11 @@
<div class="col-4">
{% spaceless %}
<h3 class="text-right cart-total"><span>{% price_range total_with_shipment %}</span>
- {% if total_with_shipment %}
+ {% if local_total_with_shipment %}
<br>
<small>
&asymp;
- {% price_range total_with_shipment %}
+ {% price_range local_total_with_shipment %}
</small>
{% endif %}
</h3>