Calling CreateShipment adds all the existing orderlines to the new shipment. You can specify that it should overwrite any existing shipment in a parameter.
If you want more "finegrained" control of the Shipment flow, you can of course modify the PurchaseOrder object directly.
custom shipping method service - problem with shipment.orderlines
I am trying to create a custom shipping service based on weight. I have created the service by using the following link
http://docs.ucommerce.net/ucommerce/v6/extending-ucommerce/shipping-method-service.html
decimal
totalWeight = 0;
foreach
(OrderLine orderline
in
shipment.OrderLines)
totalWeight += orderline.Quantity * Convert.ToDecimal(orderline[
"Weight"
]);
the problem is when calculating the weight for the order.It seems there are no orderlines in the shipment and the total weight becomes zero.
but if i use shipment.PurchaseOrder.OrderLines it retreives the weight.
decimal totalWeight = 0;
foreach (OrderLine orderline in shipment.PurchaseOrder.OrderLines)
totalWeight += orderline.Quantity * Convert.ToDecimal(orderline["Weight"]);
The weight property is getting added to the orderline in AddToBasket service.
Has anyone experienced the same or can someone point out what could be wrong?
Hello,
Sounds like you do something like:
1. TransactionLibrary.CreateShipment(...);
2. TransactionLibrary.AddToBasket(...);
In this case, the product added will be in the basket, but not assigned to the shipment.
The normal flow is:
1 TransactionLibrary.AddToBasket(...);
2 TransactionLibrary.CreateShipment(...);
Calling CreateShipment adds all the existing orderlines to the new shipment. You can specify that it should overwrite any existing shipment in a parameter.
If you want more "finegrained" control of the Shipment flow, you can of course modify the PurchaseOrder object directly.
Kind regards,
Jesper
Thanks alot Jesper - It works now :-)
is working on a reply...