mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
clarifications
This commit is contained in:
@@ -177,7 +177,8 @@ class ItemCategory(LoggedModel):
|
|||||||
collect_potential_discounts=potential_discounts_by_cartpos
|
collect_potential_discounts=potential_discounts_by_cartpos
|
||||||
)
|
)
|
||||||
|
|
||||||
# technically, this is a dict, but we use it as an OrderedSet here
|
# flatten potential_discounts_by_cartpos (a dict of lists of potential discounts) into a set of potential discounts
|
||||||
|
# (which is technically stored as a dict, but we use it as an OrderedSet here)
|
||||||
potential_discount_set = dict.fromkeys(info for lst in potential_discounts_by_cartpos.values() for info in lst)
|
potential_discount_set = dict.fromkeys(info for lst in potential_discounts_by_cartpos.values() for info in lst)
|
||||||
|
|
||||||
# sum up the max_counts and pass them on (also pass on the discount_rules so we can calculate actual discounted prices later):
|
# sum up the max_counts and pass them on (also pass on the discount_rules so we can calculate actual discounted prices later):
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ from django.views.generic.base import TemplateResponseMixin
|
|||||||
from django_scopes import scopes_disabled
|
from django_scopes import scopes_disabled
|
||||||
|
|
||||||
from pretix.base.models import Customer, Membership, Order
|
from pretix.base.models import Customer, Membership, Order
|
||||||
from pretix.base.models.items import Question
|
from pretix.base.models.items import Question, ItemCategory
|
||||||
from pretix.base.models.orders import (
|
from pretix.base.models.orders import (
|
||||||
InvoiceAddress, OrderPayment, QuestionAnswer,
|
InvoiceAddress, OrderPayment, QuestionAnswer,
|
||||||
)
|
)
|
||||||
@@ -649,10 +649,10 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
|
|||||||
@cached_property
|
@cached_property
|
||||||
def cross_selling_data(self):
|
def cross_selling_data(self):
|
||||||
class DummyCategory:
|
class DummyCategory:
|
||||||
def __init__(self, rule, subevent=None):
|
def __init__(self, category: ItemCategory, subevent=None):
|
||||||
self.id = rule.id
|
self.id = category.id
|
||||||
self.name = rule.name + (f" ({subevent})" if subevent else "")
|
self.name = category.name + (f" ({subevent})" if subevent else "")
|
||||||
self.description = rule.description
|
self.description = category.description
|
||||||
|
|
||||||
categories = self.cross_selling_applicable_categories
|
categories = self.cross_selling_applicable_categories
|
||||||
if self.event.has_subevents:
|
if self.event.has_subevents:
|
||||||
|
|||||||
Reference in New Issue
Block a user