fix outlet and articletype
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 28s
Build and Publish / BuildAndDeploy (push) Successful in 2m23s

This commit is contained in:
matst80
2024-11-14 20:52:28 +01:00
parent 2852ab5bb4
commit c8cd8bc745

View File

@@ -47,7 +47,7 @@ type CartItem struct {
Disclaimer string `json:"disclaimer,omitempty"` Disclaimer string `json:"disclaimer,omitempty"`
ArticleType string `json:"type,omitempty"` ArticleType string `json:"type,omitempty"`
Image string `json:"image,omitempty"` Image string `json:"image,omitempty"`
Outlet string `json:"outlet,omitempty"` Outlet *string `json:"outlet,omitempty"`
} }
type CartDelivery struct { type CartDelivery struct {
@@ -263,16 +263,18 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
tax = int(msg.Tax) tax = int(msg.Tax)
} }
c.Items = append(c.Items, &CartItem{ c.Items = append(c.Items, &CartItem{
Id: c.lastItemId, Id: c.lastItemId,
Quantity: int(msg.Quantity), Quantity: int(msg.Quantity),
Sku: msg.Sku, Sku: msg.Sku,
Name: msg.Name, Name: msg.Name,
Price: msg.Price, Price: msg.Price,
Image: msg.Image, Image: msg.Image,
Stock: StockStatus(msg.Stock), Stock: StockStatus(msg.Stock),
Disclaimer: msg.Disclaimer, Disclaimer: msg.Disclaimer,
OrgPrice: msg.OrgPrice, OrgPrice: msg.OrgPrice,
Tax: tax, ArticleType: msg.ArticleType,
Outlet: msg.Outlet,
Tax: tax,
}) })
c.TotalPrice += msg.Price * int64(msg.Quantity) c.TotalPrice += msg.Price * int64(msg.Quantity)
c.mu.Unlock() c.mu.Unlock()