Bundle behaviour

This commit is contained in:
Raphael Michel
2019-12-11 13:31:56 +01:00
parent 8822d572f5
commit dc298c4202
2 changed files with 53 additions and 1 deletions

View File

@@ -450,7 +450,17 @@ class CartManager:
if voucher.subevent_id and voucher.subevent_id != p.subevent_id:
continue
price = self._get_price(p.item, p.variation, voucher, None, p.subevent)
if p.is_bundled:
continue
bundled_sum = Decimal('0.00')
if not p.addon_to_id:
for bundledp in p.addons.all():
if bundledp.is_bundled:
bundledprice = bundledp.price
bundled_sum += bundledprice
price = self._get_price(p.item, p.variation, voucher, None, p.subevent, bundled_sum=bundled_sum)
if price.gross > p.price:
continue