Skip to content

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

Fix wrong calculation of subtotal value

Maciej Korycinski678d959fc47f
diff --git a/saleor/checkout/utils.py b/saleor/checkout/utils.py
index 7a70423bc5..421761e2e3 100644
--- a/saleor/checkout/utils.py
+++ b/saleor/checkout/utils.py
@@ -638,7 +638,6 @@ def get_checkout_context(
):
"""Data shared between views in checkout process."""
checkout_total = checkout.get_total(discounts, taxes)
- checkout_subtotal = checkout.get_subtotal(discounts, taxes)
shipping_required = checkout.is_shipping_required()
checkout_subtotal = checkout.get_subtotal(discounts, taxes)
total_with_shipping = TaxedMoneyRange(
diff --git a/templates/checkout/_subtotal_table.html b/templates/checkout/_subtotal_table.html
index 4364d344f7..7f90cb1a61 100644
--- a/templates/checkout/_subtotal_table.html
+++ b/templates/checkout/_subtotal_table.html
@@ -8,14 +8,14 @@
<h3>{% trans "Subtotal" context "Order subtotal" %}</h3>
</div>
<div class="col-4">
- <h3 class="text-right checkout-preview-subtotal" data-value="{% price checkout_total.gross html=False %}" {% if local_checkout_total is not None %}data-value-local="{% price local_checkout_total.gross html=False %}"{% endif %}>
+ <h3 class="text-right checkout-preview-subtotal" data-value="{% price checkout_subtotal.gross html=False %}" {% if local_checkout_subtotal is not None %}data-value-local="{% price local_checkout_subtotal.gross html=False %}"{% endif %}>
{% spaceless %}
- {% price checkout_total %}
- {% if local_checkout_total is not None and local_checkout_total.gross %}
+ {% price checkout_subtotal %}
+ {% if local_checkout_subtotal is not None and local_checkout_subtotal.gross %}
<br>
<small>
&asymp;
- {% price local_checkout_total %}
+ {% price local_checkout_subtotal %}
</small>
{% endif %}
{% endspaceless %}