mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
fix cross-selling recommendation logic bug
This commit is contained in:
@@ -303,17 +303,15 @@ class Discount(LoggedModel):
|
|||||||
if possible_applications_cond * self.benefit_only_apply_to_cheapest_n_matches > len(benefit_idx_group):
|
if possible_applications_cond * self.benefit_only_apply_to_cheapest_n_matches > len(benefit_idx_group):
|
||||||
# unused discount ("for each 1 ticket you buy, get 50% on 2 t-shirts", cart content: 1 ticket
|
# unused discount ("for each 1 ticket you buy, get 50% on 2 t-shirts", cart content: 1 ticket
|
||||||
# but 0 t-shirts) -> 2 shirt maybe potential discount (if the 1 ticket is not consumed by a later discount)
|
# but 0 t-shirts) -> 2 shirt maybe potential discount (if the 1 ticket is not consumed by a later discount)
|
||||||
|
for i, idx in enumerate(condition_idx_group[
|
||||||
#
|
n_groups * self.condition_min_count:
|
||||||
# TODO BUG:
|
possible_applications_cond * self.condition_min_count
|
||||||
# cross-selling schlägt zu viele potential discounts vor ("consume" side of rule: sobald mindestens
|
]):
|
||||||
# ein voller block übrig ist zählt auch ein letzter, angebrochener block als voll mit)
|
print(i, idx)
|
||||||
#
|
|
||||||
|
|
||||||
for i, idx in enumerate(condition_idx_group[n_groups * self.condition_min_count:]):
|
|
||||||
collect_potential_discounts[idx] += [
|
collect_potential_discounts[idx] += [
|
||||||
(self, self.benefit_only_apply_to_cheapest_n_matches, i // self.condition_min_count)
|
(self, self.benefit_only_apply_to_cheapest_n_matches, i // self.condition_min_count)
|
||||||
]
|
]
|
||||||
|
print(collect_potential_discounts)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
consume_idx = condition_idx_group
|
consume_idx = condition_idx_group
|
||||||
|
|||||||
Reference in New Issue
Block a user