SaaS CMS has officially launched! Learn more now.

How to set multiple shipping methods for cart in EpiServer 12.


Hello Guys,

I have to implement the split shipment functionality (i.e For some line items shipping method should be 'A' and for some line items shipping should be 'B'). 

It is possible like to set shipping method id and shipping method name to line item As like in 7.5?

I have looked shipment spliting

But didn't get enough infromation about how shipment methods (from commerce manager) is get set to line item.

Thank you.

Dipak Salve

May 29, 2018 14:44

You can use split shipments feature in Commerce Manager to create new shipments, add/remove items to them. Then add shipping method to each of them 

May 29, 2018 15:27

Hello Quan,

Thank you for your reply. But I am looking this through source  code on website side, just like given an example in link above. May be I posted my question in wrong area.

Thank you.

May 29, 2018 16:22

So you are trying to load the shipping method to assign to the shipment, or?

May 29, 2018 16:47

Hi Dipak,

Shipping method id and shipping method name is no longer under line item (they were obsoleted). They're now under shipment (as well as warehouse code).

In your case, I think it's possible to create multi shipments with different shipping methods, then "pick" line item to corresponding shipment.

/Viet Anh

May 29, 2018 19:40

Yes. I mean I am getting shipping method from ShippingManager

ShippingMethodDto methods = ShippingManager.GetShippingMethods(SiteContext.Current.LanguageName);
List<ShippingMethodDto.ShippingMethodRow> shippingMethods = new List<ShippingMethodDto.ShippingMethodRow>();

Now I would have to set IShipment for cart with ShippingMethodId, ShippingName  etc.

May 30, 2018 9:49

This should be enough (From Quicksilver)

        public void UpdateShippingMethod(ICart cart, int shipmentId, Guid shippingMethodId)
            var shipment = cart.GetFirstForm().Shipments.First(x => x.ShipmentId == shipmentId);
            shipment.ShippingMethodId = shippingMethodId;

You probably want to validate the cart after because the total/promotions might have been changed 

May 30, 2018 9:52
<p>Thank you. Quan this is something I was looking.</p>
May 30, 2018 11:22
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.