required("customer_name", "Name") ->minLength("customer_name", 2, "Name") ->maxLength("customer_name", 100, "Name") ->required("customer_email", "E-Mail-Adresse") ->email("customer_email", "E-Mail-Adresse") ->maxLength("customer_email", 255, "E-Mail-Adresse") ->required("organization_id", "Organisation") ->maxLength("comment", 1000, "Kommentar"); // Validate organization exists $organizationId = $_POST['organization_id'] ?? ""; $organizations = getOrganizations(true); $validOrgIds = array_column($organizations, "id"); if (!in_array($organizationId, $validOrgIds, true)) { $validator->addError("Die gewählte Organisation ist ungültig."); } if (!$validator->isValid()) { $errors = array_merge($errors, $validator->getErrors()); } elseif (!checkoutRateLimitWouldAllow()) { $errors[] = "Zu viele Bestellversuche von dieser Verbindung. Bitte versuchen Sie es später erneut."; } else { $customerName = trim($_POST['customer_name']); $customerEmail = trim(strtolower($_POST['customer_email'])); $comment = trim($_POST['comment'] ?? ""); $result = createOrder( $customerName, $customerEmail, $organizationId, $comment, buildOrderItemsFromCart(), ); if (!$result["success"]) { $errors[] = $result["message"]; } else { checkoutRateLimitTryConsume(); clearCart(); logAccess("Order created", [ "order_id" => $result["order"]["id"], "customer" => $customerEmail, ]); header( "Location: order-success.php?id=" . urlencode($result["order"]["id"]), ); exit(); } } } } include __DIR__ . "/includes/header.php"; ?>

Bestellung abschließen

Ihre Auswahl


Größe:
Lieferhinweis:

Bestelldaten

">
">
Nach dem Absenden wird die Bestellung direkt an die Gerätewarte weitergeleitet.