forked from CGM_Public/pretix_original
Show strikethrough price when voucher is granting discount
This commit is contained in:
@@ -120,11 +120,17 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web'):
|
|||||||
max_per_order
|
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:
|
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)
|
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
|
display_add_to_cart = display_add_to_cart or item.order_max > 0
|
||||||
else:
|
else:
|
||||||
for var in item.available_variations:
|
for var in item.available_variations:
|
||||||
@@ -143,11 +149,17 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web'):
|
|||||||
max_per_order
|
max_per_order
|
||||||
)
|
)
|
||||||
|
|
||||||
price = var_price_override.get(var.pk, var.price)
|
original_price = var_price_override.get(var.pk, var.price)
|
||||||
if voucher:
|
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)
|
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
|
display_add_to_cart = display_add_to_cart or var.order_max > 0
|
||||||
|
|
||||||
item.available_variations = [
|
item.available_variations = [
|
||||||
|
|||||||
Reference in New Issue
Block a user