Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

LintItem in Shipment gets removed on _orderRepository.Save(_cart)? [Commerce 11.3]

Vote:
 

Hi!

I'm trying to remove all traces of workflows but I have one problem with the cart.

Before saving the cart I have lineitems in my shipment but as soon as I call

_orderRepository.Save(_cart);

The shipment no longer has LineItems but they are still there in the OrderForm.

If I add a new item in the cart I get a new shipment with one lineitem and two items in the orderform.

I then call the save method again and the shipment ends up with no items but there is still two items in the orderform?

Any idea what could cause this problem?

/Kristoffer

#185030
Nov 08, 2017 14:32
Vote:
 

No I don't have any idea. But if you can add the full source code here, and the data in the debugger before saving to database - I would venture a guess :) 

#185039
Nov 08, 2017 16:13
Vote:
 

Hi!

Look like I had som "old school" stuff left over:

shipment.ShippingAddress.Id = checkoutViewModel.ShippingAddresses.First().Name;

I think this line of code made the added shipment to be removed. In the old Quicksilver Name was a guid but now it is the actual name. I removed that and the shipment stays intact.

/Kristoffer

#185108
Nov 09, 2017 14:35
* 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.