Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,6 +83,12 @@ def app():
|
|
| 83 |
# Output area for menu items
|
| 84 |
menu_output = gr.HTML(value=filter_menu("All"))
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
# Floating cart display
|
| 87 |
cart_output = gr.HTML(value="Your cart is empty.", elem_id="floating-cart")
|
| 88 |
|
|
@@ -189,6 +195,7 @@ def app():
|
|
| 189 |
|
| 190 |
# Interactivity
|
| 191 |
selected_preference.change(filter_menu, inputs=[selected_preference], outputs=[menu_output])
|
|
|
|
| 192 |
|
| 193 |
# Layout
|
| 194 |
gr.Row([selected_preference])
|
|
|
|
| 83 |
# Output area for menu items
|
| 84 |
menu_output = gr.HTML(value=filter_menu("All"))
|
| 85 |
|
| 86 |
+
# Redirect to cart page
|
| 87 |
+
def redirect_to_cart():
|
| 88 |
+
return update_cart()
|
| 89 |
+
|
| 90 |
+
cart_page = gr.HTML("<h2>Your Cart</h2>")
|
| 91 |
+
|
| 92 |
# Floating cart display
|
| 93 |
cart_output = gr.HTML(value="Your cart is empty.", elem_id="floating-cart")
|
| 94 |
|
|
|
|
| 195 |
|
| 196 |
# Interactivity
|
| 197 |
selected_preference.change(filter_menu, inputs=[selected_preference], outputs=[menu_output])
|
| 198 |
+
gr.Button("View Cart").click(redirect_to_cart, outputs=[cart_page])
|
| 199 |
|
| 200 |
# Layout
|
| 201 |
gr.Row([selected_preference])
|