nagasurendra commited on
Commit
03e5e50
·
verified ·
1 Parent(s): 1fb91bb

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. 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
- window.location.href = '/menu'; // Redirect to the cart page
 
 
 
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.');