diff --git a/api/place_order.php b/api/place_order.php index 60f9e71..88664e0 100644 --- a/api/place_order.php +++ b/api/place_order.php @@ -17,11 +17,16 @@ $name = trim($input['name'] ?? ''); $phoneInput = trim($input['phone'] ?? ''); $phone = normalize_oman_phone($phoneInput); $address = trim($input['address'] ?? ''); +$acceptPolicies = !empty($input['accept_policies']); $paymentMethod = trim((string) ($input['payment_method'] ?? 'pay_later')); if (!in_array($paymentMethod, ['pay_later', 'pay_online'], true)) { echo json_encode(['success' => false, 'error' => 'Invalid payment method']); exit; } +if (!$acceptPolicies) { + echo json_encode(['success' => false, 'error' => 'You must accept the Privacy Policy and Terms & Conditions']); + exit; +} if ($paymentMethod === 'pay_online' && !thawani_is_configured()) { echo json_encode(['success' => false, 'error' => 'Thawani payment is not configured']); exit; diff --git a/includes/footer_settings.php b/includes/footer_settings.php index c6622eb..5bc78ab 100644 --- a/includes/footer_settings.php +++ b/includes/footer_settings.php @@ -259,6 +259,17 @@