SathvikGanta's picture
Update components/cart.py
5242734 verified
raw
history blame
556 Bytes
cart = [] # Global cart
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
}
cart.append(item)
return cart_data()
def cart_data():
"""Return cart data."""
import pandas as pd
return pd.DataFrame(cart)