Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to create a custom shipping service based on weight. I have created the service by using the following link
decimal totalWeight = 0;
totalWeight = 0;
totalWeight += orderline.Quantity * Convert.ToDecimal(orderline[
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?
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.
Thanks alot Jesper - It works now :-)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted