Spaces:
Running
Running
| <script> | |
| const WHATSAPP_NUMBER = "919876543210"; // π΄ your real number | |
| function buy(product) { | |
| document.getElementById("product").value = product; | |
| document.getElementById("popup").style.display = "block"; | |
| } | |
| function closePopup() { | |
| document.getElementById("popup").style.display = "none"; | |
| } | |
| function placeOrder() { | |
| const product = document.getElementById("product").value.trim(); | |
| const name = document.getElementById("name").value.trim(); | |
| const phone = document.getElementById("phone").value.trim(); | |
| const room = document.getElementById("room").value.trim(); | |
| const address = document.getElementById("address").value.trim(); | |
| if (!product || !name || !phone || !room || !address) { | |
| alert("Please fill all details"); | |
| return; | |
| } | |
| const message = | |
| `π New Order | |
| Product: ${product} | |
| Name: ${name} | |
| Phone: ${phone} | |
| Room No: ${room} | |
| Address: ${address}`; | |
| const encodedMessage = encodeURIComponent(message); | |
| const url = "https://wa.me/" + WHATSAPP_NUMBER + "?text=" + encodedMessage; | |
| // π₯ This avoids 404 | |
| window.location.href = url; | |
| } | |
| </script> | |