Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add styles to shipping costs row in cart
weronkad91c367c1352
diff --git a/saleor/static/js/storefront.js b/saleor/static/js/storefront.jsindex a07a2d88ff..289b33c57e 100644--- a/saleor/static/js/storefront.js+++ b/saleor/static/js/storefront.js@@ -287,7 +287,7 @@ let $deleteAddress = $('.address-delete');// Cart quantity formlet $cartLine = $('.cart__line');-let $total = $('.cart-total');+let $total = $('.cart-subtotal');let $cartBadge = $('.navbar__brand__cart .badge');let $removeProductSucces = $('.remove-product-alert');let $closeMsg = $('.close-msg');@@ -295,7 +295,7 @@ $cartLine.each(function() {let $quantityInput = $(this).find('#id_quantity');let cartFormUrl = $(this).find('.form-cart').attr('action');let $qunatityError = $(this).find('.cart__line__quantity-error');- let $subtotal = $(this).find('.cart-item-subtotal p');+ let $subtotal = $(this).find('.cart-item-price p');let $deleteIcon = $(this).find('.cart-item-delete');$(this).on('change', $quantityInput, (e) => {let newQuantity = $quantityInput.val();diff --git a/saleor/static/scss/components/_forms.scss b/saleor/static/scss/components/_forms.scssindex efd8d55610..f0b7023a4a 100644--- a/saleor/static/scss/components/_forms.scss+++ b/saleor/static/scss/components/_forms.scss@@ -31,24 +31,19 @@}.deliveryform {- width: 100%;select {@include media-breakpoint-down(sm) {width: 100%;+ margin-top: $global-margin / 2;+ margin-left: 0;}+ margin-left: $global-margin;background-color: $white;height: calc(2.25rem + 2px);- @include media-breakpoint-up(sm) {- float: right;- }&:focus {outline: none;}}- label {- margin-right: $global-margin;- margin-top: $global-margin / 2;- }}.search-form {diff --git a/saleor/static/scss/layouts/_cart.scss b/saleor/static/scss/layouts/_cart.scssindex b62ea6eb5d..1eaaf6fd64 100644--- a/saleor/static/scss/layouts/_cart.scss+++ b/saleor/static/scss/layouts/_cart.scss@@ -34,6 +34,9 @@}}&__quantity {+ @include media-breakpoint-down(sm) {+ margin-bottom: $global-margin / 2;+ }form {display: inline-block;}@@ -64,26 +67,19 @@@include media-breakpoint-up(sm) {padding-left: 5.75rem;}+ &--shipping {+ color: $body-color;+ }}}&__delivery-info {- margin-top: $global-margin * 2;- .deliveryform {- padding: $global-padding 0;- }p {margin-bottom: 0;+ color: $body-color;+ display: inline-block;}&__price {- p {- text-align: right;- }- }- &__list {- border-top: 1px solid $gray;- .col-6 {- padding: 0;- }+ text-transform: uppercase;}}&__empty {diff --git a/templates/cart/_subtotal_table.html b/templates/cart/_subtotal_table.htmlindex c745c4ef3e..9e2cb8344b 100644--- a/templates/cart/_subtotal_table.html+++ b/templates/cart/_subtotal_table.html@@ -9,7 +9,7 @@<h3>{% trans "Subtotal" context "Order subtotal" %}</h3></div><div class="col-4">- <p class="cart-total text-right"+ <h3 class="text-right cart-subtotal"data-value="{% gross cart_total %}"{% if local_cart_total %}data-value-local="{% gross local_cart_total %}"{% endif %}>{% spaceless %}@@ -22,24 +22,24 @@</small>{% endif %}{% endspaceless %}- </p>+ </h3></div></div></div>- <div class="last table__row">+ <div class="last table__row cart__delivery-info"><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>+ <p>{% trans "Shipping cost for:" context "Cart shipping cost form" %}</p>{{ 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 class="col-md-12 col-12 text-right">+ <p class="cart__delivery-info__price">+ {% if default_country_options %}+ {% price_range default_country_options %}+ {% endif %}+ </p></div></div></div>@@ -52,18 +52,17 @@<h3>{% trans "Total" context "Order subtotal" %}</h3></div><div class="col-4">- <p class="cart-total">- {% spaceless %}- <h3 class="text-right">{% price_range total_with_shipment %}</h3>+ {% spaceless %}+ <h3 class="text-right cart-total"><span>{% price_range total_with_shipment %}</span>{% if total_with_shipment %}<br>- <h3 class="text-right"><small>+ <small>≈{% price_range total_with_shipment %}- </small></h3>+ </small>{% endif %}- {% endspaceless %}- </p>+ </h3>+ {% endspaceless %}</div></div></div>\ No newline at end of filediff --git a/templates/cart/index.html b/templates/cart/index.htmlindex 555cc01d31..776568189b 100644--- a/templates/cart/index.html+++ b/templates/cart/index.html@@ -60,7 +60,7 @@</span><small class="cart__line__quantity-error text-danger"></small></div>- <div class="cart-item-subtotal col-md-5 col-12" data-product-id="{{ line.variant.pk }}">+ <div class="cart-item-price col-md-5 col-12" data-product-id="{{ line.variant.pk }}"><p class="text-right">{% gross line.get_total html=True %}</p></div></div>