Missing fields: ".implode(", ",$missing)."
"; exit;
}
$order_id = uniqid('iskcon_');
$name = sanitize_text_field($_POST['name']);
$whatsapp = sanitize_text_field($_POST['whatsapp']);
$address = sanitize_textarea_field($_POST['address']);
$landmark = sanitize_text_field($_POST['landmark']);
$total = sanitize_text_field($_POST['total']);
$courier = sanitize_text_field($_POST['courier']);
$items = array_map('sanitize_text_field', $_POST['items']);
$items_text = implode(', ', $items);
$upi_link = "upi://pay?pa=aravindan1776@okhdfcbank&pn=Aravind&cu=INR&am=" . urlencode($total);
// Send email
$subject = "ISKCON Order: $order_id ($name)";
$body = "Order ID: $order_id\nName: $name\nWhatsApp: $whatsapp\nAddress: $address\nLandmark: $landmark\nItems: $items_text\nCourier: $courier\nTotal: ₹$total\nUPI Link: $upi_link\n";
$recipients = ['[email protected]','[email protected]'];
foreach ($recipients as $to) wp_mail($to, $subject, $body);
// Store to DB
global $wpdb;
$table = ISKCON_ORDER_TABLE;
$wpdb->insert($table, [
'order_id' => $order_id,
'name' => $name,
'whatsapp' => $whatsapp,
'address' => $address,
'landmark' => $landmark,
'items' => $items_text,
'courier' => $courier,
'total' => $total,
'upi_link' => $upi_link,
]);
// Show payment link and QR code:
?>
Complete Your Payment
Order ID:
UPI Payment Link:
Pay with Google Pay AppScan with any UPI app
Order Summary:
- Name:
- WhatsApp:
- Address: ()
- Items:
- Courier:
- Total: ₹
This page is for displaying payment info. Please return to the Order form page.