mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 12:29:24 +00:00
Improve Eboutic basket
This commit is contained in:
@ -22,13 +22,12 @@
|
||||
<div id="basket">
|
||||
<p>{% trans %}Basket: {% endtrans %}</p>
|
||||
<ul>
|
||||
{% for id,infos in request.session['basket']|dictsort %}
|
||||
{% set product = eboutic.products.filter(id=id).first() %}
|
||||
{% set s = infos['qty'] * infos['price'] / 100 %}
|
||||
<li>{{ del_product(id, '-') }} {{ infos['qty'] }} {{ add_product(id, '+') }} {{ product.name }}: {{ "%0.2f"|format(s) }} €</li>
|
||||
{% for i in basket.items.all()|sort(attribute='id') %}
|
||||
<li>{{ del_product(i.product_id, '-') }} {{ i.quantity }}
|
||||
{{ add_product(i.product_id, '+') }} {{ i.product_name }}: {{ "%0.2f"|format(i.product_unit_price*i.quantity) }} €</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><strong>{% trans %}Total: {% endtrans %}{{ "%0.2f"|format(basket_total) }} €</strong></p>
|
||||
<p><strong>{% trans %}Total: {% endtrans %}{{ "%0.2f"|format(basket.get_total()) }} €</strong></p>
|
||||
<form method="post" action="{{ url('eboutic:command') }}">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="{% trans %}Proceed to command{% endtrans %}" />
|
||||
|
@ -23,17 +23,22 @@
|
||||
{% endfor %}
|
||||
<tbody>
|
||||
</table>
|
||||
<p><strong>Total: </strong>{{ basket.get_total() }} €</p>
|
||||
<form method="post" action="{{ settings.SITH_EBOUTIC_ET_URL }}">
|
||||
{% for (field_name,field_value) in et_request.items() -%}
|
||||
<input type="hidden" name="{{ field_name }}" value="{{ field_value }}">
|
||||
{% endfor %}
|
||||
<input type="submit" value="{% trans %}Pay with credit card{% endtrans %}" />
|
||||
</form>
|
||||
{% if basket.items.filter(type="REFILLING").exists() %}
|
||||
<p>{% trans %}AE account payment disabled because your basket contains refilling items.{% endtrans %}</p>
|
||||
{% else %}
|
||||
<form method="post" action="{{ url('eboutic:pay_with_sith') }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="pay_with_sith_account">
|
||||
<input type="submit" value="{% trans %}Pay with Sith account{% endtrans %}" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -9,6 +9,7 @@
|
||||
{% else %}
|
||||
{% trans %}Payment successful{% endtrans %}
|
||||
{% endif %}
|
||||
<p><a href="{{ url('eboutic:main') }}">{% trans %}Return to eboutic{% endtrans %}</a></p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user