I’m trying to set a custom delivery cost for a SRO delivery, but it won’t update.
I’m trying with the following code:
var order = _moduleECommerce.Orders.GetOrder(sroId, _moduleECommerce.AdminToken);
if (order == null || order.Type != OrderType.SalesReturnOrder)
{
return;
}
var orderCarrier = order.GetAsCarrier(false, true, false, false, false, false);
var delivery = orderCarrier.Deliveries.FirstOrDefault();
delivery.IsCustomDeliveryCost = true;
delivery.VATPercentage = 0;
delivery.DeliveryCost = Math.Abs(shippingCost);
delivery.DeliveryCostWithVAT = 0;
delivery.KeepDeliveryCostWithVatConstant = true;
orderCarrier.TotalDeliveryCost = Math.Abs(shippingCost);
orderCarrier.TotalDeliveryCostVAT = 0;
Litium version: 7.6.2