should be item qty
This commit is contained in:
@@ -294,7 +294,7 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
|
|||||||
for i, item := range c.Items {
|
for i, item := range c.Items {
|
||||||
if item.Id == int(msg.Id) {
|
if item.Id == int(msg.Id) {
|
||||||
if msg.Quantity <= 0 {
|
if msg.Quantity <= 0 {
|
||||||
c.TotalPrice -= item.Price * int64(msg.Quantity)
|
c.TotalPrice -= item.Price * int64(item.Quantity)
|
||||||
c.Items = append(c.Items[:i], c.Items[i+1:]...)
|
c.Items = append(c.Items[:i], c.Items[i+1:]...)
|
||||||
} else {
|
} else {
|
||||||
diff := int(msg.Quantity) - item.Quantity
|
diff := int(msg.Quantity) - item.Quantity
|
||||||
|
|||||||
Reference in New Issue
Block a user