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