Fix multiply item price by quantity (#378)
This commit is contained in:
parent
491576dfa0
commit
65b5da1a9b
2 changed files with 5 additions and 3 deletions
|
@ -333,7 +333,8 @@ func (fe *frontendServer) placeOrderHandler(w http.ResponseWriter, r *http.Reque
|
|||
|
||||
totalPaid := *order.GetOrder().GetShippingCost()
|
||||
for _, v := range order.GetOrder().GetItems() {
|
||||
totalPaid = money.Must(money.Sum(totalPaid, *v.GetCost()))
|
||||
multPrice := money.MultiplySlow(*v.GetCost(), uint32(v.GetItem().GetQuantity()))
|
||||
totalPaid = money.Must(money.Sum(totalPaid, multPrice))
|
||||
}
|
||||
|
||||
currencies, err := fe.getCurrencies(r.Context())
|
||||
|
@ -415,7 +416,7 @@ func renderHTTPError(log logrus.FieldLogger, r *http.Request, w http.ResponseWri
|
|||
"status": http.StatusText(code),
|
||||
}); templateErr != nil {
|
||||
log.Println(templateErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func currentCurrency(r *http.Request) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue