mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix display_add_to_cart for variations
This commit is contained in:
committed by
GitHub
parent
bd554c7c29
commit
4b5711253e
@@ -438,9 +438,6 @@ def get_grouped_items(event, *, channel: SalesChannel, subevent=None, voucher=No
|
|||||||
base_price_is='net' if event.settings.display_net_prices else 'gross') # backwards-compat
|
base_price_is='net' if event.settings.display_net_prices else 'gross') # backwards-compat
|
||||||
) if var.original_price or item.original_price else None
|
) if var.original_price or item.original_price else None
|
||||||
|
|
||||||
if not display_add_to_cart:
|
|
||||||
display_add_to_cart = not item.requires_seat and var.order_max > 0
|
|
||||||
|
|
||||||
var.current_unavailability_reason = var.unavailability_reason(has_voucher=voucher, subevent=subevent)
|
var.current_unavailability_reason = var.unavailability_reason(has_voucher=voucher, subevent=subevent)
|
||||||
|
|
||||||
item.original_price = (
|
item.original_price = (
|
||||||
@@ -471,6 +468,8 @@ def get_grouped_items(event, *, channel: SalesChannel, subevent=None, voucher=No
|
|||||||
item.best_variation_availability = max([v.cached_availability[0] for v in item.available_variations])
|
item.best_variation_availability = max([v.cached_availability[0] for v in item.available_variations])
|
||||||
|
|
||||||
item._remove = not bool(item.available_variations)
|
item._remove = not bool(item.available_variations)
|
||||||
|
if not item._remove and not display_add_to_cart:
|
||||||
|
display_add_to_cart = not item.requires_seat and any(v.order_max > 0 for v in item.available_variations)
|
||||||
|
|
||||||
if not quota_cache_existed and not voucher and not allow_addons and not base_qs_set and not filter_items and not filter_categories:
|
if not quota_cache_existed and not voucher and not allow_addons and not base_qs_set and not filter_items and not filter_categories:
|
||||||
event.cache.set(quota_cache_key, quota_cache, 5)
|
event.cache.set(quota_cache_key, quota_cache, 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user