From 171bea59df7e2daf2864b6a7173fc5e3e1edb759 Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Tue, 23 Apr 2019 14:26:21 +0200 Subject: [PATCH] Show strikethrough price when voucher is granting discount --- src/pretix/presale/views/event.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/pretix/presale/views/event.py b/src/pretix/presale/views/event.py index 48a7fcaa0b..fe241090fd 100644 --- a/src/pretix/presale/views/event.py +++ b/src/pretix/presale/views/event.py @@ -120,11 +120,17 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web'): max_per_order ) - price = item_price_override.get(item.pk, item.default_price) + original_price = item_price_override.get(item.pk, item.default_price) if voucher: - price = voucher.calculate_price(price) + price = voucher.calculate_price(original_price) + else: + price = original_price + item.display_price = item.tax(price, currency=event.currency, include_bundled=True) + if price != original_price: + item.original_price = original_price + display_add_to_cart = display_add_to_cart or item.order_max > 0 else: for var in item.available_variations: @@ -143,11 +149,17 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web'): max_per_order ) - price = var_price_override.get(var.pk, var.price) + original_price = var_price_override.get(var.pk, var.price) if voucher: - price = voucher.calculate_price(price) + price = voucher.calculate_price(original_price) + else: + price = original_price + var.display_price = var.tax(price, currency=event.currency, include_bundled=True) + if price != original_price: + var.original_price = original_price + display_add_to_cart = display_add_to_cart or var.order_max > 0 item.available_variations = [