Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -337,10 +337,13 @@ def update_quantity():
|
|
| 337 |
FROM Cart_Item__c
|
| 338 |
WHERE Customer_Email__c = '{email}'
|
| 339 |
""")['records']
|
| 340 |
-
new_subtotal = sum(item['Price__c'] for item in cart_items)
|
| 341 |
|
| 342 |
# Return updated item price and subtotal
|
| 343 |
return jsonify({"success": True, "new_item_price": new_item_price, "subtotal": new_subtotal})
|
|
|
|
|
|
|
|
|
|
| 344 |
except Exception as e:
|
| 345 |
print(f"Error updating quantity: {str(e)}")
|
| 346 |
return jsonify({"success": False, "error": str(e)}), 500
|
|
|
|
| 337 |
FROM Cart_Item__c
|
| 338 |
WHERE Customer_Email__c = '{email}'
|
| 339 |
""")['records']
|
| 340 |
+
new_subtotal = sum(item['Price__c'] for item in cart_items)
|
| 341 |
|
| 342 |
# Return updated item price and subtotal
|
| 343 |
return jsonify({"success": True, "new_item_price": new_item_price, "subtotal": new_subtotal})
|
| 344 |
+
print(f"New item price: {new_item_price}, New subtotal: {new_subtotal}")
|
| 345 |
+
return jsonify({"success": True, "new_item_price": new_item_price, "subtotal": new_subtotal})
|
| 346 |
+
|
| 347 |
except Exception as e:
|
| 348 |
print(f"Error updating quantity: {str(e)}")
|
| 349 |
return jsonify({"success": False, "error": str(e)}), 500
|