Update cart.py
Browse files
cart.py
CHANGED
@@ -127,11 +127,10 @@ def fetch_menu_items():
|
|
127 |
category = sanitize_input(category)
|
128 |
section = sanitize_input(section)
|
129 |
|
130 |
-
# Build SOQL query
|
131 |
query = """
|
132 |
SELECT Name, Price__c, Image1__c, Veg_NonVeg__c, Section__c
|
133 |
FROM Menu_Item__c
|
134 |
-
WHERE Active__c = true
|
135 |
"""
|
136 |
if category != 'All':
|
137 |
query += f" AND Veg_NonVeg__c = '{category}'"
|
@@ -145,7 +144,7 @@ def fetch_menu_items():
|
|
145 |
return jsonify({"success": True, "menu_items": menu_items})
|
146 |
|
147 |
except Exception as e:
|
148 |
-
print(f"Error fetching menu items: {e}")
|
149 |
return jsonify({"success": False, "error": str(e)}), 500
|
150 |
|
151 |
@cart_blueprint.route("/add_suggestion_to_cart", methods=["POST"])
|
@@ -348,11 +347,10 @@ def checkout():
|
|
348 |
} for item in cart_items
|
349 |
]
|
350 |
|
351 |
-
# Fetch menu items for "Anything else you want?"
|
352 |
menu_query = """
|
353 |
SELECT Name, Price__c, Image1__c, Veg_NonVeg__c, Section__c
|
354 |
FROM Menu_Item__c
|
355 |
-
WHERE Active__c = true
|
356 |
LIMIT 20
|
357 |
"""
|
358 |
menu_result = sf.query(menu_query)
|
|
|
127 |
category = sanitize_input(category)
|
128 |
section = sanitize_input(section)
|
129 |
|
130 |
+
# Build SOQL query (removed Active__c condition)
|
131 |
query = """
|
132 |
SELECT Name, Price__c, Image1__c, Veg_NonVeg__c, Section__c
|
133 |
FROM Menu_Item__c
|
|
|
134 |
"""
|
135 |
if category != 'All':
|
136 |
query += f" AND Veg_NonVeg__c = '{category}'"
|
|
|
144 |
return jsonify({"success": True, "menu_items": menu_items})
|
145 |
|
146 |
except Exception as e:
|
147 |
+
print(f"Error fetching menu items: {str(e)}")
|
148 |
return jsonify({"success": False, "error": str(e)}), 500
|
149 |
|
150 |
@cart_blueprint.route("/add_suggestion_to_cart", methods=["POST"])
|
|
|
347 |
} for item in cart_items
|
348 |
]
|
349 |
|
350 |
+
# Fetch menu items for "Anything else you want?" (removed Active__c condition)
|
351 |
menu_query = """
|
352 |
SELECT Name, Price__c, Image1__c, Veg_NonVeg__c, Section__c
|
353 |
FROM Menu_Item__c
|
|
|
354 |
LIMIT 20
|
355 |
"""
|
356 |
menu_result = sf.query(menu_query)
|