From 9f89b2681ae28eb8b0fcc39cc7a6d70e59de4fe9 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Fri, 2 Mar 2018 15:11:28 +0100 Subject: [PATCH] save the order price in CHF --- django/didgeridoo/webshop/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django/didgeridoo/webshop/views.py b/django/didgeridoo/webshop/views.py index 0c03ec8..9d5d08a 100644 --- a/django/didgeridoo/webshop/views.py +++ b/django/didgeridoo/webshop/views.py @@ -397,11 +397,13 @@ def checkout(request): order = Order.objects.create(user=request.user, status=orderstatus) for position in cart_positions: + article = Article.objects.get(pk=position.article.id) OrderPosition.objects.create( article=position.article, order=order, amount=position.amount, - price_in_chf=position.article.price_in_chf + price_in_chf=article.price_in_chf * Decimal.from_float( + position.amount) ) return HttpResponseRedirect('/order/%s/' % order.id)