diff --git a/cmd/cart/mutation_add_item.go b/cmd/cart/mutation_add_item.go index 5f5c07b..459b9cc 100644 --- a/cmd/cart/mutation_add_item.go +++ b/cmd/cart/mutation_add_item.go @@ -30,8 +30,12 @@ func AddItem(g *CartGrain, m *messages.AddItem) error { // Fast path: merge with existing item having same SKU if existing, found := g.FindItemWithSku(m.Sku); found { - existing.Quantity += int(m.Quantity) - return nil + if existing.StoreId == m.StoreId { + existing.Quantity += int(m.Quantity) + existing.Stock = StockStatus(m.Stock) + existing.StoreId = m.StoreId + return nil + } } g.mu.Lock()