Spaces:
Sleeping
Sleeping
Update templates/menu.html
Browse files- templates/menu.html +4 -1
templates/menu.html
CHANGED
@@ -236,7 +236,10 @@
|
|
236 |
.then(data => {
|
237 |
if (data.success) {
|
238 |
alert('Item added to cart successfully!');
|
239 |
-
|
|
|
|
|
|
|
240 |
} else {
|
241 |
console.error('Error adding item to cart:', data.error);
|
242 |
alert(data.error || 'Failed to add item to cart.');
|
|
|
236 |
.then(data => {
|
237 |
if (data.success) {
|
238 |
alert('Item added to cart successfully!');
|
239 |
+
const modal = document.getElementById('itemModal');
|
240 |
+
const modalInstance = bootstrap.Modal.getInstance(modal); // Get the Bootstrap modal instance
|
241 |
+
modalInstance.hide(); // Hide the modal
|
242 |
+
// window.location.href = '/menu'; // Redirect to the cart page
|
243 |
} else {
|
244 |
console.error('Error adding item to cart:', data.error);
|
245 |
alert(data.error || 'Failed to add item to cart.');
|