From 9310e4f053d94b2879bed0ceb027c2e738135305 Mon Sep 17 00:00:00 2001 From: sameer Date: Wed, 3 Oct 2018 11:38:38 +0530 Subject: [PATCH] #shipping method bug fix --- Nop.Plugin.Api/Controllers/OrdersController.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Nop.Plugin.Api/Controllers/OrdersController.cs b/Nop.Plugin.Api/Controllers/OrdersController.cs index 0348d21..c159068 100644 --- a/Nop.Plugin.Api/Controllers/OrdersController.cs +++ b/Nop.Plugin.Api/Controllers/OrdersController.cs @@ -399,14 +399,14 @@ public IActionResult UpdateOrder([ModelBinder(typeof(JsonModelBinder)) customer, BuildShoppingCartItemsFromOrderItems(currentOrder.OrderItems.ToList(), customer.Id, storeId)); } - if (isValid) - { - currentOrder.ShippingMethod = orderDelta.Dto.ShippingMethod; - } - else - { - return Error(HttpStatusCode.BadRequest); - } + if (orderDelta.Dto.ShippingMethod != null) + { + currentOrder.ShippingMethod = orderDelta.Dto.ShippingMethod; + } + if (!isValid) + { + return Error(HttpStatusCode.BadRequest); + } } orderDelta.Merge(currentOrder); @@ -422,7 +422,7 @@ public IActionResult UpdateOrder([ModelBinder(typeof(JsonModelBinder)) var ordersRootObject = new OrdersRootObject(); var placedOrderDto = _dtoHelper.PrepareOrderDTO(currentOrder); - placedOrderDto.ShippingMethod = orderDelta.Dto.ShippingMethod; + ordersRootObject.Orders.Add(placedOrderDto);