Add multi account support to shpping cart

This commit is contained in:
2026-02-14 11:44:34 +01:00
parent 8daf064e4d
commit de4167728d
3 changed files with 49 additions and 10 deletions

View File

@@ -70,8 +70,20 @@
{% if is_cart %}
<div class="d-flex justify-content-between align-items-center mt-3">
<div>
<a href="/shop/finalize_order" class="btn btn-primary">Jetzt Buchen</a>
<div >
<form method="post" action="/shop/finalize_order" class="d-flex align-items-center">
{% if user.accounts|length > 1 %}
<select name="account_id" class="form-select form-select-sm me-2" required>
<option value="">-- Konto wählen --</option>
{% for account in user.accounts %}
<option value="{{ account.id }}">{{ account.name }} ({{ account.balance | format_number }} €)</option>
{% endfor %}
</select>
{% elif user.accounts|length == 1 %}
<input type="hidden" name="account_id" value="{{ user.accounts[0].id }}">
{% endif %}
<button type="submit" class="btn btn-primary">Jetzt Bezahlen</button>
</form>
</div>
</div>
{% endif %}