I’m trying to figure out how to set the AdditionalInfo property on a SalesOrderRow in the cart. I want to use it to set a comment on an order row.
This is what I got so far, but I don’t know how to store it so that I can access my comment in subsequent requests.
var orderRow = _cartContextAccessor.CartContext.Cart.Order.Rows.First(row => row.ArticleNumber == variant.Id);
var itemRow = orderRow.MakeWritableClone();
itemRow.AdditionalInfo ??= new Dictionary<string, object>(1);
itemRow.AdditionalInfo.Add("comment", "a comment");
Is there a service I should inject that takes care of that or am I going about it the wrong way?
An update about this from the Litium support:
“We see that this functionality is not available in Litium 8 release. We would plan to include it in a future release.”
But it is possible to set additional info on the order in Litium 8.0?
At what stage do you want to set it?
When the order has been placed you can get it with the
.MakeWritableClone(), update the
AdditionalInfo dictionary and then update the order.
We want to set additional order info and row info before and after an order is placed.
As long as we are able to access the cart or order from the db, we want to set additional info.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.