update totals
Some checks failed
Build and Publish / BuildAndDeploy (push) Successful in 3m23s
Build and Publish / BuildAndDeployAmd64 (push) Has been cancelled

This commit is contained in:
matst80
2025-05-04 14:47:11 +02:00
parent c4fbc89a0f
commit 2af4657b06

View File

@@ -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
}