Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve cart display on mobile
Paweł Kowalewskia1a3fd800661
diff --git a/saleor/cart/templates/cart/index.html b/saleor/cart/templates/cart/index.htmlindex 241dd36540..2a519cf03c 100644--- a/saleor/cart/templates/cart/index.html+++ b/saleor/cart/templates/cart/index.html@@ -17,29 +17,35 @@<table class="table table-striped cart" id="cart-items"><thead><tr>- <th class="col-sm-6">{% trans "Product" %}</th>- <th class="col-sm-2">{% trans "Quantity" %}</th>- <th class="col-sm-2 text-right">{% trans "Price" %}</th>- <th class="col-sm-2 text-right">{% trans "Subtotal" %}</th>+ <th class="col-xs-5 col-sm-2 col-md-1">{% trans "Product" %}</th>+ <th class="col-sm-5 hidden-xs"></th>+ <th class="col-xs-6 col-sm-3 col-md-2">{% trans "Quantity" %}</th>+ <th class="col-sm-1 hidden-xs text-right">{% trans "Price" %}</th>+ <th class="col-xs-1 text-right">{% trans "Subtotal" %}</th></tr></thead><tfoot><tr>- <td class="col-sm-10 text-right lead" colspan="3">{% trans "Total" %}:- <td class="col-sm-2 text-right lead"><b class="cart-total">{% gross cart.get_total %}</b></td>+ <td class="hidden-xs" colspan="2"></td>+ <td class="col-xs-9 col-md-9 text-right lead" colspan="2">{% trans "Total" %}:+ <td class="col-xs-3 col-md-2 text-right lead"><b class="cart-total">{% gross cart.get_total %}</b></td></tr></tfoot><tbody>{% for group in cart %}{% for line in group %}<tr class="cart-item">- <td>+ <td class="hidden-xs"><a href="{{ line.product.get_absolute_url }}">{% if line.product.product.images.first %}<img class="cart-item-image" itemprop="image" src="{{ line.product.product.images.first.image.crop.100x100 }}" alt="">{% else %}<img class="cart-item-image" src="{% static 'images/product-image-placeholder.png' %}" alt="">{% endif %}+ </a>+ </td>+ <td>+ <a href="{{ line.product.get_absolute_url }}">{{ line.product.product }} - {{ line.product.display_variant }}</a></td>@@ -65,7 +71,7 @@</button></div></td>- <td class="text-right">{% gross line.get_price_per_item %}</td>+ <td class="text-right hidden-xs">{% gross line.get_price_per_item %}</td><td class="text-right cart-item-subtotal" data-product-id="{{ line.product.pk }}">{% gross line.get_total %}</td>diff --git a/saleor/order/templates/order/payment.html b/saleor/order/templates/order/payment.htmlindex 8bd93b4cfe..2545aa712a 100644--- a/saleor/order/templates/order/payment.html+++ b/saleor/order/templates/order/payment.html@@ -32,7 +32,7 @@</div>{% elif payment_form %}<div class="panel-heading">- {% trans "Pay for your order" %} {{ order }}+ {% trans "Pay for order" %} {{ order }}</div><div class="panel-body"><form method="post" action="{% url "order:details" token=order.token %}">@@ -55,51 +55,12 @@</div>{% endif %}{% endif %}-- {% for group in groups %}- <div class="panel panel-default">- <div class="panel-heading">- {% blocktrans with number=forloop.counter %}Shipment #{{ number }}{% endblocktrans %}- </div>- <table class="table">- <thead>- <tr>- <th class="col-sm-6">{% trans "Name" %}</th>- <th class="col-sm-3 text-right">{% trans "Price" %}</th>- <th class="col-sm-3 text-right">{% trans "Subtotal" %}</th>- </tr>- </thead>- <tfoot>- <tr>- <th colspan="2">{% trans "Total" %}</th>- <th class="text-right">{% gross group.get_total %}</th>- </tr>- </tfoot>- <tbody>- {% for item in group %}- <tr>- <td>{{ item.product }}{% if item.quantity != 1 %} <em>×{{ item.quantity }}</em>{% endif %}</td>- <td class="text-right">{% gross item.get_price_per_item %}</td>- <td class="text-right">{% gross item.get_total %}</td>- </tr>- {% endfor %}- {% if group.shipping_price.gross %}- <tr>- <td class="col-sm-4">- {% trans "Shipping" %}- </td>- <td class="text-right">{% gross group.shipping_price %}</td>- <td class="text-right">{% gross group.shipping_price %}</td>- </tr>- {% endif %}- </tbody>- </table>- </div>- {% endfor %}</div>+ </div>+ <div class="row">{% if order.user == user %}- <div class="col-sm-4">+ <div class="col-sm-6"><div class="panel panel-default"><div class="panel-heading">{% trans "Billing address" %}@@ -108,7 +69,9 @@<address>{% include "userprofile/snippets/address-details.html" with address=order.billing_address %}</address></div></div>+ </div>+ <div class="col-sm-6">{% if order.is_shipping_required %}<div class="panel panel-default"><div class="panel-heading">@@ -122,4 +85,45 @@</div>{% endif %}</div>++ {% for group in groups %}+ <div class="panel panel-default">+ <div class="panel-heading">+ {% blocktrans with number=forloop.counter %}Shipment #{{ number }}{% endblocktrans %}+ </div>+ <table class="table">+ <thead>+ <tr>+ <th class="col-sm-6">{% trans "Name" %}</th>+ <th class="col-sm-3 text-right">{% trans "Price" %}</th>+ <th class="col-sm-3 text-right">{% trans "Subtotal" %}</th>+ </tr>+ </thead>+ <tfoot>+ <tr>+ <th colspan="2">{% trans "Total" %}</th>+ <th class="text-right">{% gross group.get_total %}</th>+ </tr>+ </tfoot>+ <tbody>+ {% for item in group %}+ <tr>+ <td>{{ item.product }}{% if item.quantity != 1 %} <em>×{{ item.quantity }}</em>{% endif %}</td>+ <td class="text-right">{% gross item.get_price_per_item %}</td>+ <td class="text-right">{% gross item.get_total %}</td>+ </tr>+ {% endfor %}+ {% if group.shipping_price.gross %}+ <tr>+ <td class="col-sm-4">+ {% trans "Shipping" %}+ </td>+ <td class="text-right">{% gross group.shipping_price %}</td>+ <td class="text-right">{% gross group.shipping_price %}</td>+ </tr>+ {% endif %}+ </tbody>+ </table>+ </div>+ {% endfor %}{% endblock content %}diff --git a/saleor/order/views.py b/saleor/order/views.pyindex 49c8be473d..3529b60f6a 100644--- a/saleor/order/views.py+++ b/saleor/order/views.py@@ -20,10 +20,8 @@ def details(request, token):orders = Order.objects.prefetch_related('groups__items')order = get_object_or_404(orders, token=token)groups = order.groups.all()- payments = order.payments.all()return TemplateResponse(request, 'order/details.html',- {'order': order, 'groups': groups,- 'payments': payments})+ {'order': order, 'groups': groups})def payment(request, token):diff --git a/saleor/static/scss/_app.scss b/saleor/static/scss/_app.scssindex a537244f6f..803c632578 100644--- a/saleor/static/scss/_app.scss+++ b/saleor/static/scss/_app.scss@@ -71,7 +71,8 @@ $icon-font-path: "../fonts/";&-item {&-image {- width: 100px;+ display: inline-block;+ max-width: 100%;}&-quantity {