Skip to content

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

Add row with total value in cart table

Mira Szewczyk652d5b6f9b83
diff --git a/saleor/static/scss/components/_forms.scss b/saleor/static/scss/components/_forms.scss
index d30ccf9b9c..efd8d55610 100644
--- a/saleor/static/scss/components/_forms.scss
+++ b/saleor/static/scss/components/_forms.scss
@@ -36,9 +36,11 @@
@include media-breakpoint-down(sm) {
width: 100%;
}
- max-width: 100%;
background-color: $white;
height: calc(2.25rem + 2px);
+ @include media-breakpoint-up(sm) {
+ float: right;
+ }
&:focus {
outline: none;
}
diff --git a/templates/cart/index.html b/templates/cart/index.html
index a470c58e21..a236010d90 100644
--- a/templates/cart/index.html
+++ b/templates/cart/index.html
@@ -69,35 +69,54 @@
</div>
</div>
{% endfor %}
- <div class="cart__total">
{% if shipping_required %}
- <div class="row">
- <div class="col-7 cart__total__subtotal">
- <h3><small>{% trans "Shipping cost for:" context "Cart secondary title" %}</small></h3>
- <br>
+ <div class="table__row">
+ <div class="row">
+ <div class="col-8 cart__total__subtotal">
+ <h3>{% trans "Subtotal" context "Order subtotal" %}</h3>
+ </div>
+ <div class="col-4">
+ <p class="cart-total text-right"
+ data-value="{% gross cart_total %}"
+ {% if local_cart_total %}data-value-local="{% gross local_cart_total %}"{% endif %}>
+ {% spaceless %}
+ {% gross cart_total html=True %}
+ {% if local_cart_total %}
+ <br>
+ <small>
+ &asymp;
+ {% gross local_cart_total html=True %}
+ </small>
+ {% endif %}
+ {% endspaceless %}
+ </p>
+ </div>
</div>
- <div class="col-5">
- <div class="row">
- <div class="col-md-7 col-12 deliveryform">
- <div class="deliveryform" data-csrf="{{ csrf_token }}">
- {{ country_form.country }}
+ </div>
+ <div class="cart__line last table__row">
+ <div class="row">
+ <div class="col-7 cart__total__subtotal deliveryform" data-csrf="{{ csrf_token }}">
+ <h3>{% trans "Shipping cost for:" context "Cart secondary title" %}</h3>
+ {{ country_form.country }}
+ </div>
+ <div class="col-5">
+ <div class="row">
+ <div class="cart-item-subtotal col-md-12 col-12">
+ <h3 class="text-right cart__delivery-info__price">
+ {% if default_country_options %}
+ {% price_range default_country_options %}
+ {% endif %}
+ </h3>
</div>
</div>
- <div class="cart-item-subtotal col-md-5 col-12">
- <h3 class="text-right cart__delivery-info__price">
- {% if default_country_options %}
- {% price_range default_country_options %}
- {% endif %}
- </h3>
- </div>
</div>
</div>
</div>
{% endif %}
+ <div class="cart__total">
<div class="row">
<div class="col-8 cart__total__subtotal">
- <h3>{% trans "Subtotal" context "Order subtotal" %}</h3>
- <p>{% trans "(Delivery calculated at checkout)" context "Cart totals help text" %}</p>
+ <h3>{% trans "Total" context "Order subtotal" %}</h3>
</div>
<div class="col-4">
<p class="cart-total text-right"