Voucher redemption: Show a checkbox if max_per_order=1

This commit is contained in:
Raphael Michel
2019-03-13 11:46:19 +01:00
parent 2c91a17927
commit 5519643782

View File

@@ -125,13 +125,24 @@
{% if var.cached_availability.0 == 100 %} {% if var.cached_availability.0 == 100 %}
<div class="col-md-2 col-xs-6 availability-box available radio-box"> <div class="col-md-2 col-xs-6 availability-box available radio-box">
{% if max_times > 1 %} {% if max_times > 1 %}
<input type="number" class="form-control input-item-count" placeholder="0" min="0" {% if item.order_max == 1 %}
pattern="\d*" <label class="item-checkbox-label">
max="{{ item.order_max }}" <input type="checkbox"
id="variation_{{ item.id }}_{{ var.id }}" value="1"
name="variation_{{ item.id }}_{{ var.id }}" id="variation_{{ item.id }}_{{ var.id }}"
{% if options == 1 %}value="1"{% endif %} name="variation_{{ item.id }}_{{ var.id }}"
title="{% blocktrans with item=item.name var=var.name %}Amount of {{ item }} {{ var }} to order{% endblocktrans %}"> {% if options == 1 %}checked{% endif %}
title="{% blocktrans with item=item.name var=var.name %}Amount of {{ item }} {{ var }} to order{% endblocktrans %}">
</label>
{% else %}
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
pattern="\d*"
max="{{ item.order_max }}"
id="variation_{{ item.id }}_{{ var.id }}"
name="variation_{{ item.id }}_{{ var.id }}"
{% if options == 1 %}value="1"{% endif %}
title="{% blocktrans with item=item.name var=var.name %}Amount of {{ item }} {{ var }} to order{% endblocktrans %}">
{% endif %}
{% else %} {% else %}
<label> <label>
<input type="radio" name="_voucher_item" <input type="radio" name="_voucher_item"
@@ -203,13 +214,24 @@
{% if item.cached_availability.0 == 100 %} {% if item.cached_availability.0 == 100 %}
<div class="col-md-2 col-xs-6 availability-box available radio-box"> <div class="col-md-2 col-xs-6 availability-box available radio-box">
{% if max_times > 1 %} {% if max_times > 1 %}
<input type="number" class="form-control input-item-count" placeholder="0" min="0" {% if item.order_max == 1 %}
pattern="\d*" <label class="item-checkbox-label">
max="{{ item.order_max }}" <input type="checkbox"
id="item_{{ item.id }}" value="1"
name="item_{{ item.id }}" id="item_{{ item.id }}"
{% if options == 1 %}value="1"{% endif %} name="item_{{ item.id }}"
title="{% blocktrans with item=item.name %}Amount of {{ item }} to order{% endblocktrans %}"> {% if options == 1 %}checked{% endif %}
title="{% blocktrans with item=item.name %}Amount of {{ item }} to order{% endblocktrans %}">
</label>
{% else %}
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
pattern="\d*"
max="{{ item.order_max }}"
id="item_{{ item.id }}"
name="item_{{ item.id }}"
{% if options == 1 %}value="1"{% endif %}
title="{% blocktrans with item=item.name %}Amount of {{ item }} to order{% endblocktrans %}">
{% endif %}
{% else %} {% else %}
<label> <label>
<input type="radio" name="_voucher_item" <input type="radio" name="_voucher_item"