update totals
This commit is contained in:
@@ -285,7 +285,7 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
|
||||
existingItem, found := c.FindItemWithSku(msg.Sku)
|
||||
if found {
|
||||
existingItem.Quantity += int(msg.Quantity)
|
||||
c.TotalPrice += existingItem.Price * int64(msg.Quantity)
|
||||
c.UpdateTotals()
|
||||
} else {
|
||||
return c.AddItem(msg.Sku, int(msg.Quantity)) // extent AddRequest to include quantity
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user