forked from CGM_Public/pretix_original
Cart: Use price before rounding as custom price for plus button (#5780)
This commit is contained in:
@@ -313,12 +313,12 @@
|
||||
<input type="hidden" name="variation_{{ line.item.id }}_{{ line.variation.id }}"
|
||||
value="1" />
|
||||
<input type="hidden" name="price_{{ line.item.id }}_{{ line.variation.id }}"
|
||||
value="{% if event.settings.display_net_prices %}{{ line.bundle_sum_net }}{% else %}{{ line.bundle_sum }}{% endif %}" />
|
||||
value="{% if event.settings.display_net_prices %}{{ line.price_for_input_net }}{% else %}{{ line.price_for_input }}{% endif %}" />
|
||||
{% else %}
|
||||
<input type="hidden" name="item_{{ line.item.id }}"
|
||||
value="1" />
|
||||
<input type="hidden" name="price_{{ line.item.id }}"
|
||||
value="{% if event.settings.display_net_prices %}{{ line.bundle_sum_net }}{% else %}{{ line.bundle_sum }}{% endif %}" />
|
||||
value="{% if event.settings.display_net_prices %}{{ line.price_for_input_net }}{% else %}{{ line.price_for_input }}{% endif %}" />
|
||||
{% endif %}
|
||||
<button class="btn btn-mini btn-link {% if line.seat %}btn-invisible{% endif %}" title="{% blocktrans with item=line.item.name %}Add one more {{item}} to your cart{% endblocktrans %}" {% if line.seat %}disabled{% endif %}>
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
|
||||
@@ -209,6 +209,8 @@ class CartMixin:
|
||||
pos.valid_from,
|
||||
pos.valid_until,
|
||||
pos.used_membership_id,
|
||||
pos.gross_price_before_rounding,
|
||||
pos.tax_value_before_rounding,
|
||||
)
|
||||
|
||||
positions = []
|
||||
@@ -222,8 +224,8 @@ class CartMixin:
|
||||
if not hasattr(group, 'tax_rule'):
|
||||
group.tax_rule = group.item.tax_rule
|
||||
|
||||
group.bundle_sum = group.price + sum(a.price for a in has_addons[group.pk])
|
||||
group.bundle_sum_net = group.net_price + sum(a.net_price for a in has_addons[group.pk])
|
||||
group.price_for_input = group.gross_price_before_rounding + sum(a.gross_price_before_rounding for a in has_addons[group.pk])
|
||||
group.price_for_input_net = group.net_price_before_rounding + sum(a.net_price_before_rounding for a in has_addons[group.pk])
|
||||
|
||||
if answers:
|
||||
group.cache_answers(all=False)
|
||||
|
||||
Reference in New Issue
Block a user