nagasurendra commited on
Commit
a5663b6
·
verified ·
1 Parent(s): d008279

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -141,7 +141,9 @@ def cart():
141
  WHERE Customer_Email__c = '{email}'
142
  """)
143
  cart_items = result.get("records", [])
144
- subtotal = sum(item['Price__c'] * item['Quantity__c'] for item in cart_items)
 
 
145
 
146
  return render_template("cart.html", cart_items=cart_items, subtotal=subtotal, customer_email=email)
147
  except Exception as e:
 
141
  WHERE Customer_Email__c = '{email}'
142
  """)
143
  cart_items = result.get("records", [])
144
+ # Subtotal should be the sum of all item prices in the cart
145
+ subtotal = sum(item['Price__c'] for item in cart_items)
146
+
147
 
148
  return render_template("cart.html", cart_items=cart_items, subtotal=subtotal, customer_email=email)
149
  except Exception as e: