-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.js
More file actions
32 lines (25 loc) · 921 Bytes
/
payment.js
File metadata and controls
32 lines (25 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// This should be called when navigating from the main meals page
const savedOrder = JSON.parse(localStorage.getItem("orderDetails")) || [];
function populateOrderSummary() {
const orderList = document.getElementById("orderList");
let total = 0;
orderList.innerHTML = "";
savedOrder.forEach(item => {
const line = document.createElement("div");
line.className = "order-item";
line.innerHTML = `
<span>${item.name} x ${item.qty}</span>
<span>₹${item.qty * item.price}</span>
`;
total += item.qty * item.price;
orderList.appendChild(line);
});
document.getElementById("totalAmountDisplay").innerText = `Total: ₹${total}`;
}
function confirmOrder() {
document.getElementById("confirmationPopup").style.display = "block";
}
function goToPayment() {
window.location.href = "qr.html"; // Redirect to your final payment page
}
window.onload = populateOrderSummary;