Store "extra info" on product rows in cart?

Hi, I need to be able to append some extra info to each product in the users cart, is there built in support for this in Litium?

For example if I want the user to be able to add a comment to each poduct instance? Can I append that to the product/session somehow or should I just store this info on the orderInformation with productId+i as key?

Litium version: 6.2

You can try to use AdditionalOrderInfo to add more information.

On each order.OrderRow you will have a Comment field where you can store additional comments to the actual row. In some solutions this field is used to store a configuration of the product as a json string.

If your question is answered please set this issue to resolved :slight_smile:

Common practice is as Patric says is to use the comment to store information. We usually create a class with the properties that we want on eatch order row, serialize as JSON and store in the comment and then deserialize and use when we need something.

{
“myProductText”: “This is my tshirt”,
“orderRowComment”: “order row comment”
}

if you only need to store a text and don’t use comment for anything else you can just store the text as the comment

I had an issue with storing data on the comment since the Free gift-campaign writes campaign name to the comment field for some reason (reported a bug on this).

I ended up using the externalcampaignid-field instead. @patric.forsgard perhaps the solution with dynamic object should be added to orderrow, it is is common that data need to be saved here.

And one more thing, if cart is persisted in db or cookie then I have understood it so that the only thing saved there is articlenumber and quantity so comments will be lost (I have not verified this).

Should it be better if no comment was added that notifies you about the free gift?

We are looking to get this more flexible. Please create a bug (feature request) where we can collect and see all needs so we can add correct functionality.

The cart is always stored in DB but the reference to the cart object can be either the logged in UserID or the CookieID. The comment should be included in the stored shopping cart, if that not is working for you, please create a bug.

There is a campaign-id field on the row, isn’t that enough?

Done :slight_smile: Login

1 Like