From f0d926d437faf6bb6aa0aec3ceb8892e0190f77e Mon Sep 17 00:00:00 2001 From: skoshelev Date: Mon, 14 Sep 2020 16:03:20 +0300 Subject: [PATCH] #5006 Fixed problem with the logic in CreateOrUpadeteShipping --- .../Services/ShipStationService.cs | 7 +++++-- src/Plugins/Nop.Plugin.Shipping.ShipStation/plugin.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Plugins/Nop.Plugin.Shipping.ShipStation/Services/ShipStationService.cs b/src/Plugins/Nop.Plugin.Shipping.ShipStation/Services/ShipStationService.cs index 137d4a2dd59..898327512f3 100644 --- a/src/Plugins/Nop.Plugin.Shipping.ShipStation/Services/ShipStationService.cs +++ b/src/Plugins/Nop.Plugin.Shipping.ShipStation/Services/ShipStationService.cs @@ -447,6 +447,8 @@ public void CreateOrUpadeteShipping(string orderNumber, string carrier, string s decimal totalWeight = 0; + _shipmentService.InsertShipment(shipment); + foreach (var orderItem in _orderService.GetOrderItems(order.Id)) { var product = _productService.GetProductById(orderItem.ProductId); @@ -473,7 +475,8 @@ public void CreateOrUpadeteShipping(string orderNumber, string carrier, string s { OrderItemId = orderItem.Id, Quantity = orderItem.Quantity, - WarehouseId = warehouseId + WarehouseId = warehouseId, + ShipmentId = shipment.Id }; _shipmentService.InsertShipmentItem(shipmentItem); @@ -481,7 +484,7 @@ public void CreateOrUpadeteShipping(string orderNumber, string carrier, string s shipment.TotalWeight = totalWeight; - _shipmentService.InsertShipment(shipment); + _shipmentService.UpdateShipment(shipment); } else { diff --git a/src/Plugins/Nop.Plugin.Shipping.ShipStation/plugin.json b/src/Plugins/Nop.Plugin.Shipping.ShipStation/plugin.json index 01ba56a935d..e8c91ccb2e2 100644 --- a/src/Plugins/Nop.Plugin.Shipping.ShipStation/plugin.json +++ b/src/Plugins/Nop.Plugin.Shipping.ShipStation/plugin.json @@ -2,7 +2,7 @@ "Group": "Shipping rate computation", "FriendlyName": "ShipStation", "SystemName": "Shipping.ShipStation", - "Version": "1.06", + "Version": "1.07", "SupportedVersions": [ "4.40" ], "Author": "nopCommerce team", "DisplayOrder": 1,