Spaces:
Sleeping
Sleeping
Update components/cart.py
Browse files- components/cart.py +4 -5
components/cart.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
cart = [] # Global cart
|
2 |
|
3 |
def add_to_cart(dish_name, spice_level, extras, instructions, quantity):
|
4 |
"""Add selected item to the cart."""
|
@@ -8,12 +8,11 @@ def add_to_cart(dish_name, spice_level, extras, instructions, quantity):
|
|
8 |
"Extras": ", ".join(extras) if extras else "None",
|
9 |
"Instructions": instructions,
|
10 |
"Quantity": quantity,
|
11 |
-
"Price": f"${(quantity * 10.0):.2f}" # Example price
|
12 |
}
|
13 |
cart.append(item)
|
14 |
return cart_data()
|
15 |
|
16 |
def cart_data():
|
17 |
-
"""Return cart
|
18 |
-
|
19 |
-
return pd.DataFrame(cart)
|
|
|
1 |
+
cart = [] # Global cart list
|
2 |
|
3 |
def add_to_cart(dish_name, spice_level, extras, instructions, quantity):
|
4 |
"""Add selected item to the cart."""
|
|
|
8 |
"Extras": ", ".join(extras) if extras else "None",
|
9 |
"Instructions": instructions,
|
10 |
"Quantity": quantity,
|
11 |
+
"Price": f"${(quantity * 10.0):.2f}" # Example price calculation
|
12 |
}
|
13 |
cart.append(item)
|
14 |
return cart_data()
|
15 |
|
16 |
def cart_data():
|
17 |
+
"""Return the cart as a list of dictionaries."""
|
18 |
+
return cart
|
|