Skip to content

Commit

Permalink
Fix display price for vouchers with all_bundles_included
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Jan 22, 2024
1 parent 0938bf3 commit 6474240
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/pretix/presale/views/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web', require
original_price = item_price_override.get(item.pk, item.default_price)
if voucher:
price = voucher.calculate_price(original_price)
include_bundled = not voucher.all_bundles_included
else:
price = original_price
include_bundled = True

item.display_price = item.tax(price, currency=event.currency, include_bundled=True)
item.display_price = item.tax(price, currency=event.currency, include_bundled=include_bundled)
if item.free_price and item.free_price_suggestion is not None:
item.suggested_price = item.tax(max(price, item.free_price_suggestion), currency=event.currency, include_bundled=True)
item.suggested_price = item.tax(max(price, item.free_price_suggestion), currency=event.currency, include_bundled=include_bundled)
else:
item.suggested_price = item.display_price

Expand Down Expand Up @@ -384,17 +386,19 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web', require
original_price = var_price_override.get(var.pk, var.price)
if voucher:
price = voucher.calculate_price(original_price)
include_bundled = not voucher.all_bundles_included
else:
price = original_price
include_bundled = True

var.display_price = var.tax(price, currency=event.currency, include_bundled=True)
var.display_price = var.tax(price, currency=event.currency, include_bundled=include_bundled)

if item.free_price and var.free_price_suggestion is not None:
var.suggested_price = item.tax(max(price, var.free_price_suggestion), currency=event.currency,
include_bundled=True)
include_bundled=include_bundled)
elif item.free_price and item.free_price_suggestion is not None:
var.suggested_price = item.tax(max(price, item.free_price_suggestion), currency=event.currency,
include_bundled=True)
include_bundled=include_bundled)
else:
var.suggested_price = var.display_price

Expand Down

0 comments on commit 6474240

Please sign in to comment.