Spaces:
Sleeping
Sleeping
File size: 560 Bytes
58036b7 06b3f12 5242734 06b3f12 58036b7 5242734 58036b7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
cart = [] # Global cart list
def add_to_cart(dish_name, spice_level, extras, instructions, quantity):
"""Add selected item to the cart."""
item = {
"Dish": dish_name,
"Spice Level": spice_level,
"Extras": ", ".join(extras) if extras else "None",
"Instructions": instructions,
"Quantity": quantity,
"Price": f"${(quantity * 10.0):.2f}" # Example price calculation
}
cart.append(item)
return cart_data()
def cart_data():
"""Return the cart as a list of dictionaries."""
return cart
|