Skip to content

Instantly share code, notes, and snippets.

@boxbilling
Created June 22, 2012 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save boxbilling/2971349 to your computer and use it in GitHub Desktop.
Save boxbilling/2971349 to your computer and use it in GitHub Desktop.
Enable quantity input field in all type of payments
<div class="box">
<div class="block pricing">
<div class="total">
{% if pricing.type == 'free' %}
{% if product.allow_quantity_select %}
<label>{% trans 'Quantity:' %}
<input type="text" name="quantity" value="1" style="width:30px;"/>
</label>
<hr/>
{% endif %}
<p>{% trans 'Total price:' %}</p>
<div class="currency">{{ mf.currency(0) }}</div>
{% endif %}
{% if pricing.type == 'once' %}
{% if product.allow_quantity_select %}
<label>{% trans 'Quantity:' %}
<input type="text" name="quantity" value="1" style="width:30px;"/>
</label>
<hr/>
{% endif %}
<p>{% trans 'Total price:' %}</p>
<div class="currency">{{ mf.currency(pricing.once.price + pricing.once.setup) }}</div>
{% endif %}
{% if pricing.type == 'recurrent' %}
{% if product.allow_quantity_select %}
<label>{% trans 'Quantity:' %}
<input type="text" name="quantity" value="1" style="width:30px;"/>
</label>
<hr/>
{% endif %}
<select name="period" id="period-selector">
{% for code,prices in pricing.recurrent %}
{% if prices.enabled %}
<option value="{{code}}"{% if request.period == code %} selected="selected"{% endif %}>{{ periods[code] }}</option>
{% endif %}
{% endfor %}
</select>
{% for code,prices in pricing.recurrent %}
{% if prices.enabled %}
{% if prices.setup > 0 %}
<div class="period {{code}}" style="display: none;">
<table>
<tr>
<td>{% trans 'Price' %}</td>
<td>{{ mf.currency(prices.price) }}</td>
</tr>
<tr>
<td>{% trans 'Setup Price' %}</td>
<td>{{ mf.currency(prices.setup) }}</td>
</tr>
</table>
</div>
{% endif %}
{% endif %}
{% endfor %}
<hr/>
<p>{% trans 'Total price:' %}</p>
{% for code,prices in pricing.recurrent %}
<div class="currency period {{code}}">{{ mf.currency(prices.price + prices.setup) }}</div>
{% endfor %}
{% endif %}
</div>
{% if product.addons|length > 0 %}
<button class="bb-button bb-button-submit bb-button-big" type="submit" id="order-button">{% trans 'Continue' %}</button>
{% else %}
<button class="bb-button bb-button-submit bb-button-big" type="submit" id="order-button">{% trans 'Order now' %}</button>
{% endif %}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment