Merge branch 'cart' of git.2li.ch:ibz/web_AI-5 into cart
* 'cart' of git.2li.ch:ibz/web_AI-5: fix the currency calculation in the cart add some empty lines for better readability
This commit is contained in:
commit
037df6b9bc
|
@ -232,6 +232,7 @@ def cart(request):
|
||||||
print('currencies currency_name:', currency_name)
|
print('currencies currency_name:', currency_name)
|
||||||
else:
|
else:
|
||||||
request.session['currency'] = None
|
request.session['currency'] = None
|
||||||
|
|
||||||
# here we react to a change of amount per item in the Cart:
|
# here we react to a change of amount per item in the Cart:
|
||||||
if 'amount_form' in request.POST:
|
if 'amount_form' in request.POST:
|
||||||
amount_form = CartForm(request.POST)
|
amount_form = CartForm(request.POST)
|
||||||
|
@ -245,6 +246,7 @@ def cart(request):
|
||||||
amount,
|
amount,
|
||||||
operation
|
operation
|
||||||
)
|
)
|
||||||
|
|
||||||
# here we react to a change of amount per item in the Cart:
|
# here we react to a change of amount per item in the Cart:
|
||||||
if 'delete' in request.POST:
|
if 'delete' in request.POST:
|
||||||
delete = CartForm(request.POST)
|
delete = CartForm(request.POST)
|
||||||
|
@ -273,7 +275,8 @@ def cart(request):
|
||||||
# enumerate the list of articles and loop over items:
|
# enumerate the list of articles and loop over items:
|
||||||
for idx, cart_position in enumerate(cart_position_list):
|
for idx, cart_position in enumerate(cart_position_list):
|
||||||
# scrap out the details to calculate Total of item and Summ of All:
|
# scrap out the details to calculate Total of item and Summ of All:
|
||||||
if currency:
|
if request.session['currency']:
|
||||||
|
currency = request.session['currency']
|
||||||
# get currencyname to display:
|
# get currencyname to display:
|
||||||
currency_name = ExchangeRate_name.objects.get(id=currency)
|
currency_name = ExchangeRate_name.objects.get(id=currency)
|
||||||
# get exchange_rate multiplyed:
|
# get exchange_rate multiplyed:
|
||||||
|
|
Loading…
Reference in New Issue