Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -163,6 +163,8 @@ def add_to_cart():
|
|
| 163 |
item_price = data.get('itemPrice')
|
| 164 |
item_image = data.get('itemImage')
|
| 165 |
addons = data.get('addons', [])
|
|
|
|
|
|
|
| 166 |
customer_email = session.get('user_email') # Get logged-in user's email from session
|
| 167 |
|
| 168 |
# Validate the required fields
|
|
@@ -203,7 +205,7 @@ def add_item_to_cart():
|
|
| 203 |
"Customer_Email__c": email, # Associate the cart item with the customer's email
|
| 204 |
"Item_Name__c": item_name, # Item name
|
| 205 |
"Quantity__c": quantity, # Quantity to add
|
| 206 |
-
"Add_Ons__c":
|
| 207 |
})
|
| 208 |
|
| 209 |
return jsonify({"success": True, "message": "Item added to cart successfully."})
|
|
|
|
| 163 |
item_price = data.get('itemPrice')
|
| 164 |
item_image = data.get('itemImage')
|
| 165 |
addons = data.get('addons', [])
|
| 166 |
+
addons_string = ";".join(addons) if addons else "None"
|
| 167 |
+
|
| 168 |
customer_email = session.get('user_email') # Get logged-in user's email from session
|
| 169 |
|
| 170 |
# Validate the required fields
|
|
|
|
| 205 |
"Customer_Email__c": email, # Associate the cart item with the customer's email
|
| 206 |
"Item_Name__c": item_name, # Item name
|
| 207 |
"Quantity__c": quantity, # Quantity to add
|
| 208 |
+
"Add_Ons__c": addons_string
|
| 209 |
})
|
| 210 |
|
| 211 |
return jsonify({"success": True, "message": "Item added to cart successfully."})
|