fix the currency calculation in the cart

This commit is contained in:
Andreas Zweili 2018-02-25 17:26:43 +01:00
parent 1c52e938c3
commit 81f0fc0c4b
1 changed files with 7 additions and 7 deletions

View File

@ -269,21 +269,21 @@ def cart(request):
cart_position_list = list(cart_positions)
# enumerate the list of articles and loop over items:
for idx, cart_position in enumerate(cart_position_list):
# *************************************************
# !!! here i don't understand how its intended
# to use the utils function.
# cart_position = process_article_prices(request, cart_position)
# *************************************************
# scrap out the details to calculate Total of item and Summ of All:
if currency:
# get currencyname to display:
currency_name = ExchangeRate_name.objects.get(id=currency)
# get exchange_rate multiplyed:
cart_position.price_in_chf = rate.exchange(
cart_position.article.price_in_chf = rate.exchange(
currency,
cart_position.article.price_in_chf
)
totalprice_list.append(cart_position.price_in_chf)
cart_position.position_price = rate.exchange(
currency,
cart_position.position_price
)
cart_position.calculate_position_price()
totalprice_list.append(cart_position.position_price)
amount_form = CartForm(
initial={'amount_form': cart_position.amount}
)