mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Hide payment fees if they are all equal to 0.00
This commit is contained in:
@@ -381,6 +381,7 @@ class PaymentStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
ctx = super().get_context_data(**kwargs)
|
ctx = super().get_context_data(**kwargs)
|
||||||
ctx['providers'] = self.provider_forms
|
ctx['providers'] = self.provider_forms
|
||||||
|
ctx['show_fees'] = any(p['fee'] for p in self.provider_forms)
|
||||||
ctx['selected'] = self.request.POST.get('payment', self.request.session.get('payment', ''))
|
ctx['selected'] = self.request.POST.get('payment', self.request.session.get('payment', ''))
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% elif c.min_count == 0 %}
|
{% elif c.min_count == 0 %}
|
||||||
{% blocktrans trimmed with max_count=c.max_count %}
|
{% blocktrans trimmed with max_count=c.max_count %}
|
||||||
You can to choose up to {{ max_count }} options from this category.
|
You can choose up to {{ max_count }} options from this category.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% blocktrans trimmed with min_count=c.min_count max_count=c.max_count %}
|
{% blocktrans trimmed with min_count=c.min_count max_count=c.max_count %}
|
||||||
|
|||||||
@@ -13,7 +13,9 @@
|
|||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h4 class="panel-title">
|
<h4 class="panel-title">
|
||||||
<label class="radio">
|
<label class="radio">
|
||||||
<strong class="pull-right">+ {{ p.fee|floatformat:2 }} {{ event.currency }}</strong>
|
{% if show_fees %}
|
||||||
|
<strong class="pull-right">+ {{ p.fee|floatformat:2 }} {{ event.currency }}</strong>
|
||||||
|
{% endif %}
|
||||||
<input type="radio" name="payment" value="{{ p.provider.identifier }}"
|
<input type="radio" name="payment" value="{{ p.provider.identifier }}"
|
||||||
data-parent="#payment_accordion"
|
data-parent="#payment_accordion"
|
||||||
{% if selected == p.provider.identifier %}checked="checked"{% endif %}
|
{% if selected == p.provider.identifier %}checked="checked"{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user