Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -243,8 +243,18 @@ def modal_js():
|
|
243 |
totalCostElement.innerText = `Total Cart Cost: $${totalCartCost.toFixed(2)}`;
|
244 |
}
|
245 |
function proceedToCheckout() {
|
246 |
-
|
247 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
// Reset all selected add-ons when opening a new item modal
|
249 |
function resetAddOns() {
|
250 |
const checkboxes = document.querySelectorAll('input[name="biryani-extra"]');
|
|
|
243 |
totalCostElement.innerText = `Total Cart Cost: $${totalCartCost.toFixed(2)}`;
|
244 |
}
|
245 |
function proceedToCheckout() {
|
246 |
+
// Build the cart summary string with item details
|
247 |
+
const cartSummary = cart.map(item => `
|
248 |
+
${item.name} (x${item.quantity}) - $${item.totalCost.toFixed(2)}
|
249 |
+
Extras: ${item.extras.map(extra => extra.name).join(', ') || 'None'}
|
250 |
+
Instructions: ${item.instructions || 'None'}
|
251 |
+
`).join('\n');
|
252 |
+
|
253 |
+
// Show an alert with the cart summary
|
254 |
+
alert(`Proceeding to checkout...\n\nCart Summary:\n\n${cartSummary}\n\nTotal Cost: $${totalCartCost.toFixed(2)}`);
|
255 |
+
}
|
256 |
+
|
257 |
+
|
258 |
// Reset all selected add-ons when opening a new item modal
|
259 |
function resetAddOns() {
|
260 |
const checkboxes = document.querySelectorAll('input[name="biryani-extra"]');
|