delivery pickup point
This commit is contained in:
@@ -428,7 +428,7 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
|
|||||||
Id: c.lastDeliveryId,
|
Id: c.lastDeliveryId,
|
||||||
Provider: msg.Provider,
|
Provider: msg.Provider,
|
||||||
PickupPoint: msg.PickupPoint,
|
PickupPoint: msg.PickupPoint,
|
||||||
Price: 49,
|
Price: 4900,
|
||||||
Items: items,
|
Items: items,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -500,6 +500,21 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
|
|||||||
ImageURL: fmt.Sprintf("https://www.elgiganten.se%s", item.Image),
|
ImageURL: fmt.Sprintf("https://www.elgiganten.se%s", item.Image),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
for _, line := range c.Deliveries {
|
||||||
|
if line.Price > 0 {
|
||||||
|
orderLines = append(orderLines, &Line{
|
||||||
|
Type: "shipping_fee",
|
||||||
|
Reference: line.Provider,
|
||||||
|
Name: "Delivery",
|
||||||
|
Quantity: 1,
|
||||||
|
UnitPrice: int(line.Price),
|
||||||
|
TaxRate: 2500, // item.TaxRate,
|
||||||
|
QuantityUnit: "st",
|
||||||
|
TotalAmount: int(line.Price),
|
||||||
|
TotalTaxAmount: int(GetTaxAmount(line.Price, 2500)),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
order := CheckoutOrder{
|
order := CheckoutOrder{
|
||||||
PurchaseCountry: "SE",
|
PurchaseCountry: "SE",
|
||||||
PurchaseCurrency: "SEK",
|
PurchaseCurrency: "SEK",
|
||||||
@@ -588,6 +603,7 @@ func (c *CartGrain) UpdateTotals() {
|
|||||||
}
|
}
|
||||||
for _, delivery := range c.Deliveries {
|
for _, delivery := range c.Deliveries {
|
||||||
c.TotalPrice += delivery.Price
|
c.TotalPrice += delivery.Price
|
||||||
|
c.TotalTax += GetTaxAmount(delivery.Price, 2500)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user