Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -993,6 +993,9 @@ def update_quantity():
|
|
| 993 |
print(f"Error updating quantity: {str(e)}")
|
| 994 |
return jsonify({"success": False, "error": str(e)}), 500
|
| 995 |
|
|
|
|
|
|
|
|
|
|
| 996 |
@app.route("/checkout", methods=["POST"])
|
| 997 |
def checkout():
|
| 998 |
email = session.get('user_email')
|
|
@@ -1142,7 +1145,8 @@ def checkout():
|
|
| 1142 |
print(f"Deleting Cart Item: {item['Id']}") # Debugging cart item deletion
|
| 1143 |
sf.Cart_Item__c.delete(item["Id"])
|
| 1144 |
|
| 1145 |
-
|
|
|
|
| 1146 |
|
| 1147 |
except Exception as e:
|
| 1148 |
print(f"Error during checkout: {str(e)}") # Debugging error message
|
|
|
|
| 993 |
print(f"Error updating quantity: {str(e)}")
|
| 994 |
return jsonify({"success": False, "error": str(e)}), 500
|
| 995 |
|
| 996 |
+
|
| 997 |
+
from flask import redirect, url_for
|
| 998 |
+
|
| 999 |
@app.route("/checkout", methods=["POST"])
|
| 1000 |
def checkout():
|
| 1001 |
email = session.get('user_email')
|
|
|
|
| 1145 |
print(f"Deleting Cart Item: {item['Id']}") # Debugging cart item deletion
|
| 1146 |
sf.Cart_Item__c.delete(item["Id"])
|
| 1147 |
|
| 1148 |
+
# Redirect to the order summary page
|
| 1149 |
+
return redirect(url_for('order_summary', email=email))
|
| 1150 |
|
| 1151 |
except Exception as e:
|
| 1152 |
print(f"Error during checkout: {str(e)}") # Debugging error message
|