OTC-Overlay-Defaults und Buttonzustand korrigieren
This commit is contained in:
@@ -14,7 +14,7 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
|
||||
|
||||
$otcProductRows .= '<div class="sg-form-sections-card__field-group">';
|
||||
$otcProductRows .= '<label class="sg-label" for="' . $inputId . '">' . $productName . '</label>';
|
||||
$otcProductRows .= '<input class="sg-interaction-element sg-input-single-line" type="number" id="' . $inputId . '" min="0" max="' . $availableQty . '" step="1" value="0" data-otc-order-product data-product-id="' . $productId . '" data-title="' . $productName . '" data-available-qty="' . $availableQty . '">';
|
||||
$otcProductRows .= '<input class="sg-interaction-element sg-input-single-line" type="number" id="' . $inputId . '" min="0" max="' . $availableQty . '" step="1" data-otc-order-product data-product-id="' . $productId . '" data-title="' . $productName . '" data-available-qty="' . $availableQty . '">';
|
||||
$otcProductRows .= '</div>';
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
|
||||
echo '<h2 id="otc-total-price-title" class="sg-strong sg-form-sections-card__chapter-title">Preis</h2>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<label class="sg-label" for="otc-total-price">Preis alle Flaschen brutto (CHF)</label>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="number" id="otc-total-price" min="0" step="0.01" value="0.00" data-otc-order-total-price>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="number" id="otc-total-price" min="0" step="0.01" data-otc-order-total-price>';
|
||||
echo '<p class="sg-body sg-form-sections-card__sentence">Der Preis wird durch die Anzahl aller Flaschen geteilt und das Ergebnis ist der Preis jeder einzelnen Flasche.</p>';
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
@@ -155,27 +155,27 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
|
||||
echo '<h2 id="otc-billing-title" class="sg-strong sg-form-sections-card__chapter-title">Rechnungsadresse</h2>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<label class="sg-label" for="otc-first-name">Vorname</label>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-first-name" value="Fabienne" data-otc-order-first-name>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-first-name" data-otc-order-first-name>';
|
||||
echo '</div>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<label class="sg-label" for="otc-last-name">Nachname</label>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-last-name" value="Föhn" data-otc-order-last-name>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-last-name" data-otc-order-last-name>';
|
||||
echo '</div>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<label class="sg-label" for="otc-street">Strasse</label>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-street" value="Im Hochrain" data-otc-order-street>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-street" data-otc-order-street>';
|
||||
echo '</div>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<label class="sg-label" for="otc-house-number">Hausnummer</label>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-house-number" value="2" data-otc-order-house-number>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-house-number" data-otc-order-house-number>';
|
||||
echo '</div>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<label class="sg-label" for="otc-zip">PLZ</label>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-zip" value="8102" data-otc-order-zip>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-zip" data-otc-order-zip>';
|
||||
echo '</div>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<label class="sg-label" for="otc-city">Ort</label>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-city" value="Oberengstringen" data-otc-order-city>';
|
||||
echo '<input class="sg-interaction-element sg-input-single-line" type="text" id="otc-city" data-otc-order-city>';
|
||||
echo '</div>';
|
||||
echo '<div class="sg-form-sections-card__field-group">';
|
||||
echo '<div class="sg-body sg-otc-order-form__status hidden" data-otc-order-success>Bestellung erfolgreich erfasst! Die Bestellnummer wird automatisch generiert.</div>';
|
||||
@@ -394,8 +394,6 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
|
||||
echo " };";
|
||||
echo " const resetForm = (preserveSuccess = false) => {";
|
||||
echo " form.reset();";
|
||||
echo " productInputs.forEach((input) => { input.value = '0'; });";
|
||||
echo " if (totalPriceInput) { totalPriceInput.value = '0.00'; }";
|
||||
echo " clearError();";
|
||||
echo " if (!preserveSuccess) { clearSuccess(); }";
|
||||
echo " if (!preserveSuccess) { updateFormState(); }";
|
||||
@@ -455,6 +453,7 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
|
||||
echo " const originalBtnText = submitBtn.innerHTML;";
|
||||
echo " submitBtn.innerHTML = '<span class=\"loading\"></span> Wird verarbeitet...';";
|
||||
echo " submitBtn.disabled = true;";
|
||||
echo " submitBtn.classList.add('sg-button--process-inactive');";
|
||||
echo " clearError();";
|
||||
echo " try {";
|
||||
echo " const response = await fetch('/api/otc-order.php', {";
|
||||
|
||||
Reference in New Issue
Block a user