Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -561,15 +561,13 @@ def order_summary():
|
|
561 |
|
562 |
# Fetch the applied coupon codes for the user
|
563 |
coupon_result = sf.query(f"""
|
564 |
-
SELECT Coupon_Code__c
|
565 |
FROM Referral_Coupon__c
|
566 |
WHERE Customer_Email__c = '{email}' AND Coupon_Status__c = 'Active'
|
567 |
""")
|
568 |
|
569 |
-
|
570 |
-
|
571 |
-
coupon = coupon_result['records'][0]
|
572 |
-
discount = coupon.get('Discount__c', 0.0) # Assuming Discount__c is a custom field for discount
|
573 |
|
574 |
# Calculate the final total after applying discount
|
575 |
final_total = order['Total_Amount__c'] - discount # Final price after discount
|
|
|
561 |
|
562 |
# Fetch the applied coupon codes for the user
|
563 |
coupon_result = sf.query(f"""
|
564 |
+
SELECT Coupon_Code__c
|
565 |
FROM Referral_Coupon__c
|
566 |
WHERE Customer_Email__c = '{email}' AND Coupon_Status__c = 'Active'
|
567 |
""")
|
568 |
|
569 |
+
discount_percentage = 10 # Apply 10% discount
|
570 |
+
discount = order['Total_Amount__c'] * (discount_percentage / 100) # Calculate the discount value
|
|
|
|
|
571 |
|
572 |
# Calculate the final total after applying discount
|
573 |
final_total = order['Total_Amount__c'] - discount # Final price after discount
|