I'm trying to add a new product to the shopping cart through a generic handler (.ashx). The item appears in the cart if i add it through an onclick event on the asp.net button, but item doesn't show up when i add it through the generic handler.
Both cart (through aspx and ashx) have the same ShoppingCartID and GUID, but the items that are stored in the ShoppingCartObject is different. Any help would be greatly appreciated.
var skuId = QueryHelper.GetInteger("id", -1);
if (skuId <= 0)
return;
var product = SKUInfoProvider.GetSKUInfo(skuId);
if (product == null)
return;
// Get current shopping cart
var cart = ECommerceContext.CurrentShoppingCart;
// Ensure cart in database
ShoppingCartInfoProvider.SetShoppingCartInfo(cart);
// Add item to cart object
var param = new ShoppingCartItemParameters(product.SKUID, 1);
ShoppingCartItemInfo cartItem = cart.SetShoppingCartItem(param);
// Save item to database
ShoppingCartItemInfoProvider.SetShoppingCartItemInfo(cartItem);