CartItemCustomData value not set

Nirav mehta asked on October 24, 2014 16:59

Hi,

I am trying to use CartItemCustomData and I am setting value like this

ShoppingCartItemInfo.CartItemCustomData.SetValue("Image1", imageId);

i have also tried

ShoppingCart.ShoppingCartCustomData.SetValue("Image1", imageId);

none of this stores value in database.

i have checked COM_ShoppingCartSKU and COM_ShoppingCart in database and both has Null values in ShoppingCartCustomData field.

Regard, Nirav

Correct Answer

Brenden Kehren answered on October 24, 2014 17:08

Typically when you set a value like this ShoppingCartItemInfo.CartItemCustomData.SetValue("Image1", imageId); you'd need to do something like ShoppingCartItemInfo.Update(); or ShoppingCartItemInfoProvider.SetShoppingCartItemInfo(ShoppingCartItemInfo); to actually save the value to the object.

2 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.