Spaces:
Sleeping
Sleeping
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 | |