From 61124c7000a052810ccbaefe75df333acb372068 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Fri, 2 Mar 2018 16:19:58 +0100 Subject: [PATCH] correct the order view --- django/didgeridoo/webshop/templates/webshop/order.html | 9 ++------- django/didgeridoo/webshop/views.py | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/django/didgeridoo/webshop/templates/webshop/order.html b/django/didgeridoo/webshop/templates/webshop/order.html index 301f7aa..c243df9 100644 --- a/django/didgeridoo/webshop/templates/webshop/order.html +++ b/django/didgeridoo/webshop/templates/webshop/order.html @@ -22,7 +22,6 @@ NAME STOCK AMOUNT - PRICE p.pce. POSITION PRICE {% for order_position, price, pos_price in order_position_list_zip %} @@ -37,16 +36,12 @@ {{ order_position.article.stock }} {{ order_position.amount }} - {{ price }} - {{ currency_name }} - - - {{ pos_price }} {{ currency_name }} + {{ price }} {{ currency_name }} {% endfor %} - +
Total:
diff --git a/django/didgeridoo/webshop/views.py b/django/didgeridoo/webshop/views.py index ea6fd80..b9fe97d 100644 --- a/django/didgeridoo/webshop/views.py +++ b/django/didgeridoo/webshop/views.py @@ -456,10 +456,9 @@ def order(request, order_id): else: currency_name = 'CHF' price = order_position.price_in_chf - position_price = price * Decimal.from_float(order_position.amount) order_position_list[idx] = order_position price_list.append(price) - totalprice_list.append(position_price) + totalprice_list.append(price) total = sum(totalprice_list) order_position_list_zip = zip(order_position_list, price_list,