On the checkout page I add some additional order information (CurrentState.Current.ShoppingCart.OrderCarrier.AdditionalOrderInfo), but when an order is placed (with Klarna checkout) and we get to the confirmed state (OrderStateBuilder), the orderCarrier’s AdditionalOrderInfo is now empty.
How do I save additional order information which I can retreive by the time the order is confirmed? I need these values for our order export.
It is possible that you save your AdditionalOrderInfo after its been saved on disc.
You can check that in Files/Klarna… and if your additional information is not there then it will be empty of course.
It appears the AdditionalOrderInfo I want is not in the Klarna files. But how will I be able to add them correctly?
We have a checkout page where you can change some options, for example setting a delivery service point. These options do ajax calls to Litium to save these values to AdditionalOrderInfo of the ordercarrier. I’m a bit unsure how to do this correctly.
I’ve tried using CurrentState.Current.ShoppingCart.OrderCarrier and CartService.OrderCarrier.AdditionalOrderInfo but that does not seem to help.
Another thing I noticed when using CurrentState is that it will return the wrong website during ajax calls. I wonder if it will also give me the wrong ShoppingCart/OrderCarrier?
So, my question is, how do I set these values so that they end up in the order that is sent to Klarna?
After updating the order in the shopping cart the order for Klarna need to be updated, this is done automatically in the IPaymentWidget.GetWidget method for the Klarna payment widget (implemented in KlarnaPaymentWidgetController).
If you not refreshing the widget you anyway need to update the order information that is sent and stored for Klarna, see the above method with the call of method klarnaCheckout.CreateOrUpdateKcoOrder that you manually need to invoke.
Note: File and method names is from Acceleratorn 6.3 but I think it should be the same in your version also.