nagasurendra commited on
Commit
dbe304b
·
verified ·
1 Parent(s): 5652eb4

Update templates/customdish.html

Browse files
Files changed (1) hide show
  1. templates/customdish.html +7 -12
templates/customdish.html CHANGED
@@ -679,11 +679,10 @@
679
  addMessage('bot', 'No dish selected. Please choose a dish first.');
680
  return;
681
  }
682
-
683
  const textarea = document.querySelector('.selected-customization-ingredients textarea');
684
  const instructions = textarea ? textarea.value.trim() : '';
685
-
686
-
687
  fetch('/submit_customization_ingredients', {
688
  method: 'POST',
689
  headers: { 'Content-Type': 'application/json' },
@@ -698,15 +697,10 @@
698
  if (data.success) {
699
  addToCart({ ...selectedMenuItem, instructions, ingredients: selectedIngredients });
700
  currentStep = 'post_cart';
701
- addMessage('bot', 'Customization submitted successfully! Item added to cart. Would you like to order more?');
702
- const options = [
703
- { text: 'Yes', class: 'green' },
704
- { text: 'No', class: 'red' }
705
- ];
706
- displayOptions(options);
707
- selectedMenuItem = null;
708
- selectedIngredients = [];
709
- displayCart();
710
  } else {
711
  addMessage('bot', `Error: ${data.error}`);
712
  }
@@ -716,6 +710,7 @@
716
  });
717
  }
718
 
 
719
  function fetchIngredients(foodPreference) {
720
  fetch('/get_ingredients', {
721
  method: 'POST',
 
679
  addMessage('bot', 'No dish selected. Please choose a dish first.');
680
  return;
681
  }
682
+
683
  const textarea = document.querySelector('.selected-customization-ingredients textarea');
684
  const instructions = textarea ? textarea.value.trim() : '';
685
+
 
686
  fetch('/submit_customization_ingredients', {
687
  method: 'POST',
688
  headers: { 'Content-Type': 'application/json' },
 
697
  if (data.success) {
698
  addToCart({ ...selectedMenuItem, instructions, ingredients: selectedIngredients });
699
  currentStep = 'post_cart';
700
+ addMessage('bot', 'Customization submitted successfully! Item added to cart.');
701
+
702
+ // Redirect to the cart page
703
+ window.location.href = '/cart/cart'; // This will redirect the user to the cart page
 
 
 
 
 
704
  } else {
705
  addMessage('bot', `Error: ${data.error}`);
706
  }
 
710
  });
711
  }
712
 
713
+
714
  function fetchIngredients(foodPreference) {
715
  fetch('/get_ingredients', {
716
  method: 'POST',