nagasurendra commited on
Commit
76df88b
·
verified ·
1 Parent(s): 95b25f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -258,11 +258,22 @@ def modal_js():
258
  document.getElementById('checkout-summary').innerHTML = checkoutSummary;
259
  document.getElementById('cart-modal').style.display = 'none';
260
  document.getElementById('checkout-page').style.display = 'block';
 
 
 
 
 
 
261
  }
262
  function goBackToMenu() {
263
  document.getElementById('menu-page').style.display = 'block';
264
  document.getElementById('cart-modal').style.display = 'none';
265
  }
 
 
 
 
 
266
  </script>
267
  """
268
  return modal_script
 
258
  document.getElementById('checkout-summary').innerHTML = checkoutSummary;
259
  document.getElementById('cart-modal').style.display = 'none';
260
  document.getElementById('checkout-page').style.display = 'block';
261
+
262
+ // Clear cart after submission
263
+ cart = [];
264
+ totalCartCost = 0;
265
+ updateCartButton();
266
+ updateCartTotalCost();
267
  }
268
  function goBackToMenu() {
269
  document.getElementById('menu-page').style.display = 'block';
270
  document.getElementById('cart-modal').style.display = 'none';
271
  }
272
+ // Reset all selected add-ons when opening a new item modal
273
+ function resetAddOns() {
274
+ const checkboxes = document.querySelectorAll('input[name="biryani-extra"]');
275
+ checkboxes.forEach(checkbox => checkbox.checked = false); // Uncheck all add-ons
276
+ }
277
  </script>
278
  """
279
  return modal_script