Add Item to Cart Manually

Sep 3, 2009 at 12:09 PM

Hi,

I'm trying to modify NB_Store in ProductList so the problem is how to add item to cart manually.

I found the function

NEvoWeb.Modules.NB_Store.CurrentCart.AddItemToCart(PortalId, Item)

But I cannot how to declare Item.

How can I define Item manually?

I try

Dim Item As New NEvoWeb.Modules.NB_Store.NB_Store_CartItemsInfo()
Item.ItemID = 7

I use NB_Store 1.1.6

but it does not work.

Please give me some help.

Sep 3, 2009 at 1:38 PM

Hi,

You need to look at the function

Public Shared Sub AddItemToCart(ByVal PortalID As Integer, ByVal objCIInfo As NB_Store_CartItemsInfo, Optional ByVal Request As HttpRequest = Nothing)

in the currentcart class to do an add cart item like that.

Have a look at the function

Public Shared Sub AddItemToCart(ByVal PortalID As Integer, ByVal LItem As DataListItem, ByVal IncrementCart As Boolean, Optional ByVal Request As HttpRequest = Nothing)

and you'll see how that's working, it builds up the cartitem from the datalist item and then calls the add to cart at the bottom.

Regards,

Dave.