nagasurendra commited on
Commit
462dd46
·
verified ·
1 Parent(s): dc12568

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
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
- # Redirect to the order summary page (successful redirect)
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