geethareddy commited on
Commit
4ee00c6
·
verified ·
1 Parent(s): 6a2c65c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -12,7 +12,7 @@ logging.basicConfig(level=logging.INFO)
12
  # Global variables
13
  cart = [] # To store items, quantities, and prices
14
  MENU = {
15
- "Biryani": {"Chicken Biryani": 250, "Veg Biryani": 200, "Mutton Biryani": 300},
16
  "Starters": {"Chicken Wings": 220, "Paneer Tikka": 180, "Fish Fingers": 250, "Spring Rolls": 160},
17
  "Breads": {"Butter Naan": 50, "Garlic Naan": 60, "Roti": 40, "Lachha Paratha": 70},
18
  "Curries": {"Butter Chicken": 300, "Paneer Butter Masala": 250, "Dal Tadka": 200, "Chicken Tikka Masala": 320},
@@ -187,6 +187,19 @@ def process_command(command):
187
  awaiting_quantity = True
188
  return f"How many quantities of {current_item} would you like?"
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  # Handle other commands
191
  return "Sorry, I didn't understand that. Please try again."
192
 
 
12
  # Global variables
13
  cart = [] # To store items, quantities, and prices
14
  MENU = {
15
+ "Biryanis": {"Chicken Biryani": 250, "Veg Biryani": 200, "Mutton Biryani": 300},
16
  "Starters": {"Chicken Wings": 220, "Paneer Tikka": 180, "Fish Fingers": 250, "Spring Rolls": 160},
17
  "Breads": {"Butter Naan": 50, "Garlic Naan": 60, "Roti": 40, "Lachha Paratha": 70},
18
  "Curries": {"Butter Chicken": 300, "Paneer Butter Masala": 250, "Dal Tadka": 200, "Chicken Tikka Masala": 320},
 
187
  awaiting_quantity = True
188
  return f"How many quantities of {current_item} would you like?"
189
 
190
+ # Handle item removal from cart
191
+ if "remove" in command:
192
+ if current_item:
193
+ for item in cart:
194
+ if item[0].lower() == current_item.lower():
195
+ cart.remove(item)
196
+ total = sum(i[1] * i[2] for i in cart)
197
+ cart_summary = ", ".join([f"{i[0]} x{i[2]} (₹{i[1] * i[2]})" for i in cart])
198
+ return f"Removed {item[0]} from your cart. Updated cart: {cart_summary}. Total: ₹{total}."
199
+ return f"{current_item} is not in your cart."
200
+ else:
201
+ return "Please specify the item you want to remove."
202
+
203
  # Handle other commands
204
  return "Sorry, I didn't understand that. Please try again."
205