nagasurendra commited on
Commit
f4b07da
·
verified ·
1 Parent(s): eed9133

Update menu.py

Browse files
Files changed (1) hide show
  1. menu.py +5 -10
menu.py CHANGED
@@ -94,17 +94,12 @@ def menu():
94
  if item['Name'] in added_item_names:
95
  continue
96
 
97
- # If no category is selected, show all items
98
- if selected_category == "All":
99
- best_sellers = all_items # Show all items when "All" is selected or when no toggle is selected
100
-
101
- elif selected_category == "Veg":
102
- best_sellers = [item for item in all_items if item.get("Veg_NonVeg__c") in ["Veg", "both"]]
103
 
104
- elif selected_category == "Customized Dish":
105
- best_sellers = custom_dishes # Show only customized dishes when that toggle is selected
106
- else:
107
- best_sellers = all_items # Default to all items in case of other selectio
108
  ordered_menu[section].append(item)
109
  added_item_names.add(item['Name']) # Add item to the set of added items
110
  print(f"Added item to {section}: {item['Name']}") # Debugging
 
94
  if item['Name'] in added_item_names:
95
  continue
96
 
97
+ # Apply category filters
98
+ if selected_category == "Veg" and item.get("Veg_NonVeg__c") not in ["Veg", "both"]:
99
+ continue
100
+ if selected_category == "Non veg" and item.get("Veg_NonVeg__c") not in ["Non veg", "both"]:
101
+ continue
 
102
 
 
 
 
 
103
  ordered_menu[section].append(item)
104
  added_item_names.add(item['Name']) # Add item to the set of added items
105
  print(f"Added item to {section}: {item['Name']}") # Debugging