getMessage()); } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $company_name = trim($_POST['company_name'] ?? ''); $admin_whatsapp = trim($_POST['admin_whatsapp'] ?? ''); $admin_email = trim($_POST['admin_email'] ?? ''); $admin_address = trim($_POST['admin_address'] ?? ''); // Form validations if (empty($company_name) || empty($admin_whatsapp) || empty($admin_email) || empty($admin_address)) { $error = 'All fields are required to update settings.'; } elseif (!filter_var($admin_email, FILTER_VALIDATE_EMAIL)) { $error = 'Please enter a valid email address.'; } else { try { $sql = "UPDATE settings SET company_name = :company_name, admin_whatsapp = :admin_whatsapp, admin_email = :admin_email, admin_address = :admin_address WHERE id = 1"; $stmt = $pdo->prepare($sql); $stmt->execute([ ':company_name' => $company_name, ':admin_whatsapp' => $admin_whatsapp, ':admin_email' => $admin_email, ':admin_address' => $admin_address ]); $success = 'Company settings updated successfully!'; // Reload settings $settings = get_admin_settings($pdo); } catch (PDOException $e) { $error = 'Failed to save settings: ' . $e->getMessage(); } } } include '../includes/admin_header.php'; ?>
The Admin WhatsApp Number is used to generate direct links for your clients. When they click the final Order via WhatsApp button on the checkout page, their mobile application will open a direct chat window with this number, prefilling the structured order request.
+, ( ), or dashes - in the WhatsApp number field. E.g., Use 94771234567 instead of +94 (77) 123-4567.