Update README with pricing plans and enhance WhatsApp ordering functionality

This commit is contained in:
Anurag Jangid 2026-10-08 04:15:17 +05:30
parent b985e6f470
commit 5eb16ec8c9
3 changed files with 41 additions and 10 deletions

View file

@ -21,6 +21,8 @@ const pricing = {
},
};
const WHATSAPP_NUMBER = "919453226814";
const options = [
{ label: "Breakfast, lunch & dinner", detail: "3 meals a day" },
{ label: "Lunch & dinner", detail: "2 meals a day" },
@ -50,13 +52,14 @@ document.querySelector("#pricing-options").innerHTML = options
document.querySelector("#customize-form").addEventListener("submit", (event) => {
event.preventDefault();
const form = new FormData(event.currentTarget);
const subject = `${selected.name} mode — customized tiffin`;
const body = [
const message = [
"Hi The Tiffin Food! I would like to customize my tiffin.",
"",
`Plan: ${selected.name} mode`,
`Destination: ${form.get("destination")}`,
`Preferred delivery window: ${form.get("timing")}`,
`Meal preferences: ${form.get("preferences") || "None specified"}`,
].join("\n");
window.location.href = `mailto:hello@thetiffinfood.com?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
document.querySelector(".form-note").textContent = "Opening your email app with your tiffin preferences.";
document.querySelector(".form-note").textContent = "Opening WhatsApp with your tiffin preferences.";
window.location.href = `https://wa.me/${WHATSAPP_NUMBER}?text=${encodeURIComponent(message)}`;
});