Saving gift card recipient details

Payal gupta asked on April 24, 2020 08:11

Hi Team,

In my ecommerce site I need to save recipient email and name.

In existing shopping cart tables any column is there where I can store these details?

I have found one column in OrderItemCustomData under COM_OrderItem table. Can any one help me to understand this column?

Can I use this column to save custom details?

Recent Answers


Brenden Kehren answered on April 24, 2020 08:59

You can store the data in that column if you wish. I'd suggest storing it as XML.

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on April 24, 2020 10:16

Hi Payal,

It's better to utilize Text Options for product here. There will be your Gift Card product and it will have 2 Text Options: recipient email and recipient name. Working with options is a bit easier because you can use Kentico API.

1 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on April 24, 2020 22:19 (last edited on April 25, 2020 00:04)

You have to set value in the shopping cart item first.

 ShoppingCartItemInfo product = shoppingService
                                    .GetCurrentShoppingCart()
                                    .CartProducts
                                    .FirstOrDefault();
  product.CartItemCustomData.SetValue("Name", NameValue);
  product.CartItemCustomData.SetValue("Email", EmailValue);
  product.Update()

This custom data is transferred from cart item to order item automatically, when the order is submitted (when you create order from shopping cart). Internally they stored as xml inside the DB.

Same goes for cartInfo and orderInfo. So you can decide where you want to keep your custom data at the order level or at the item level.

0 votesVote for this answer Mark as a Correct answer

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