Hide payment fees if they are all equal to 0.00

This commit is contained in:
Raphael Michel
2017-05-02 19:12:42 +02:00
parent 394c206133
commit 8294391ebc
3 changed files with 5 additions and 2 deletions

View File

@@ -381,6 +381,7 @@ class PaymentStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
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', ''))
return ctx

View File

@@ -35,7 +35,7 @@
{% endblocktrans %}
{% elif c.min_count == 0 %}
{% 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 %}
{% else %}
{% blocktrans trimmed with min_count=c.min_count max_count=c.max_count %}

View File

@@ -13,7 +13,9 @@
<div class="panel-heading">
<h4 class="panel-title">
<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 }}"
data-parent="#payment_accordion"
{% if selected == p.provider.identifier %}checked="checked"{% endif %}