diff --git a/django/didgeridoo/currencies/views.py b/django/didgeridoo/currencies/views.py index 4a5ac1f..e08c236 100644 --- a/django/didgeridoo/currencies/views.py +++ b/django/didgeridoo/currencies/views.py @@ -4,7 +4,7 @@ from currencies.models import (ExchangeRate, ExchangeRate_date, ExchangeRate_name) from currencies import exchange_rates -from django.http import JsonResponse +from webshop.utils import get_categories def currencies(request): @@ -160,9 +160,10 @@ def currencies(request): """ # know we can query our data for presentaton: ordered_currency_list = ExchangeRate.objects.order_by('name', 'date') - + category_list = get_categories() # and publish it on template: return render(request, 'currencies/index.html', {'ordered_currency_list': ordered_currency_list, + 'category_list': category_list, 'message': message}) diff --git a/django/didgeridoo/webshop/templates/webshop/checkout.html b/django/didgeridoo/webshop/templates/webshop/checkout.html index f8e32b3..95ab7c3 100644 --- a/django/didgeridoo/webshop/templates/webshop/checkout.html +++ b/django/didgeridoo/webshop/templates/webshop/checkout.html @@ -59,6 +59,14 @@
{{ total }} {{ currency_name }}
+ + + +
Exchange Rate to 1 CHF:
+ +
{{ exchange_rate }}
+ +
{% csrf_token %} diff --git a/django/didgeridoo/webshop/views.py b/django/didgeridoo/webshop/views.py index c4944e3..28bcf84 100644 --- a/django/didgeridoo/webshop/views.py +++ b/django/didgeridoo/webshop/views.py @@ -416,10 +416,12 @@ def checkout(request): 'category_list': category_list, 'message': message, 'person': person, + 'exchange_rate': exchange_rate, }) def order(request, order_id): + category_list = get_categories() totalprice_list = [] order_position_list = [] cart = ShoppingCart.objects.get(user=request.user) @@ -457,4 +459,5 @@ def order(request, order_id): 'order_position_list': order_positions, 'total': total, 'currency_name': currency_name, + 'category_list': category_list, })