Add option/variant value to AddToBasket.aspx

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
weblications
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Tue Jun 30, 2009 11:58 am

Add option/variant value to AddToBasket.aspx

Post by weblications » Tue Aug 11, 2009 6:14 am

I need to be able to add multiple products to a basket in one shot - I can do this with the script below. However, this will not work if there is an option attached to the product - Which I have on every product! Any way to set an option/variant value when uising the script below? Here is my code (VB):

Dim basketItem As BasketItem = BasketItemDataSource.CreateForProduct(_ProductId, 1)
If basketItem IsNot Nothing Then
'ADD ITEM TO BASKET
Dim basket As Basket = Token.Instance.User.Basket
basket.Items.Add(basketItem)
basket.Save()

' IF BASKET HAVE SOME VALIDATION PROBLEMS MOVE TO BASKET PAGE
Dim basketMessages As List(Of String)
If Not basket.Validate(basketMessages) Then
Session.Add("BasketMessage", basketMessages)
Response.Redirect(NavigationHelper.GetBasketUrl())
End If
End If

The basket message is misleading - tells me that the product has been delete.

Any help would be greatly appreciated.

Thanks. Bob

Post Reply