Changes to the booking process in regarts to the trial processing

This commit is contained in:
2026-09-06 22:00:51 +02:00
parent 0853de417a
commit f64df11380
3 changed files with 26 additions and 32 deletions
+2 -1
View File
@@ -2585,7 +2585,8 @@ def booking_payment():
return redirect(url_for("user_chat"))
if booking_flow in ["payment", "trial"]:
booking_number = f"{"TRIAL" if is_trial else "BOOK"}-{datetime.utcnow().strftime('%Y%m%d%H%M%S')}"
# CORRECTED: Syntax error in the f-string is fixed below (uses single quotes inside double quotes)
booking_number = f"{'TRIAL' if is_trial else 'BOOK'}-{datetime.utcnow().strftime('%Y%m%d%H%M%S')}"
raw_base = form_data.get("tenant_slug") or form_data.get("school_name") or session.get("username") or booking_number
base = _slugify_subdomain(raw_base).lower()[:51]
Binary file not shown.
+24 -31
View File
@@ -260,35 +260,6 @@
</div>
</article>
<!-- STARTPAKET (Kombi) -->
<!--<article class="package-card highlight">
<div class="package-card__header">
<div>
<span class="package-card__tag highlight-tag">Sparpaket</span>
<h2 class="package-card__name">Startpaket</h2>
</div>
<div class="package-card__price">
<span>420 €</span><small>/ Jahr</small>
</div>
</div>
<p class="package-card__description">Enthält <strong>Inventarverwaltung</strong> und <strong>Bibliothekssystem</strong> als ideale Komplettlösung zum Vorzugspreis.</p>
<ul class="package-card__features">
<li>Beinhaltet alle Features des Inventarsystems</li>
<li>Beinhaltet alle Features des Bibliothekssystems</li>
<li>Perfekter Start für Ihre Digitalisierung</li>
<li><strong>30 € Ersparnis</strong> gegenüber Einzelkauf</li>
</ul>
<div class="package-card__actions">
{% if 'username' in session %}
<button class="btn add-to-cart-btn" data-id="startpaket" data-name="Startpaket (Inventar + Bibliothek)" data-price="420" onclick="handleAddToCart(this)">
In den Warenkorb
</button>
{% else %}
<a class="btn secondary" href="{{ url_for('login') }}">Zum Buchen einloggen</a>
{% endif %}
</div>
</article>-->
<!-- SCHULTRÄGER -->
<article class="package-card">
<div class="package-card__header">
@@ -364,8 +335,8 @@
<div class="custom-modal-actions" id="cartActions">
<button class="btn secondary" type="button" onclick="closeCartModal()">Weiter umsehen</button>
<button class="btn outline" type="button" onclick="goToCheckout('consultation')">Beratungstermin anfragen</button>
<button class="btn" type="button" onclick="goToCheckout('payment')">Jetzt Zahlungspflichtig buchen</button>
<button class="btn outline" type="button" id="btnConsultation" onclick="goToCheckout('consultation')">Beratungstermin anfragen</button>
<button class="btn" type="button" id="btnCheckout" onclick="goToCheckout('payment')">Jetzt Zahlungspflichtig buchen</button>
</div>
</div>
</div>
@@ -435,6 +406,28 @@
} else {
totalPriceEl.innerText = `${total} € / Jahr`;
}
// Dynamic Checkout Button Text & Behavior
const btnCheckout = document.getElementById('btnCheckout');
const btnConsultation = document.getElementById('btnConsultation');
const isTrial = cart.some(item => item.id === 'testversion');
const isCustom = cart.some(item => item.id === 'schultraeger');
if (isTrial) {
btnCheckout.innerText = "Kostenlos testen (14 Tage)";
btnCheckout.setAttribute('onclick', "goToCheckout('trial')");
btnConsultation.style.display = 'none'; // Hide consultation for trials
} else if (isCustom) {
btnCheckout.innerText = "Angebot anfordern";
btnCheckout.setAttribute('onclick', "goToCheckout('consultation')"); // Force consultation
btnConsultation.style.display = 'none';
} else {
btnCheckout.innerText = "Jetzt Zahlungspflichtig buchen";
btnCheckout.setAttribute('onclick', "goToCheckout('payment')");
btnConsultation.style.display = 'inline-block';
}
}
// Artikel zum Warenkorb hinzufügen