Hi, I'm getting the attached error when using the add to cart button on the home page. I can add products fine from the product page. Just wondered if anyone knew what might be causing this.
Thanks in advance
Rob Gardner
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at CommerceBuilder.Utility.AlwaysConvert.ToIntArray(String parseValue)
at CommerceBuilder.Products.ProductCalculator..ctor(Int32 A_0, Int16 A_1, String A_2, String A_3, Int32 A_4, Boolean A_5)
at CommerceBuilder.Products.ProductCalculator.LoadForProduct(Int32 productId, Int16 quantity, String optionList, String kitList, Int32 userId, Boolean calculateTax)
at CommerceBuilder.Products.ProductCalculator.LoadForProduct(Int32 productId, Int16 quantity, String optionList, String kitList, Int32 userId)
at CommerceBuilder.Orders.BasketItemDataSource.CreateForProduct(Int32 productId, Int16 quantity, String optionList, String kitList, Int32 userId)
at CommerceBuilder.Orders.BasketItemDataSource.CreateForProduct(Int32 productId, Int16 quantity)
at ConLib_AddToCartLink.AddToCart()
at ConLib_AddToCartLink.Page_Init(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem)
at System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource)
at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)
at Webparts_FeaturedProductsGrid.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Add to Cart Error
- Shopping Cart Admin
- AbleCommerce Admin
- Posts: 3055
- Joined: Mon Dec 01, 2003 8:41 pm
- Location: Vancouver, WA
- Contact:
Re: Add to Cart Error
Hello Rob,
It might be important to know which control is embedded into the home page that is displaying the products.
It might be important to know which control is embedded into the home page that is displaying the products.
Re: Add to Cart Error
Hi, it's the FeaturedProductsGrid. It works fine on my test IIS server - I only get the problem on the live server, but the site and web.config are the same.
Thanks
Rob
Thanks
Rob
Re: Add to Cart Error
Hi, I'm still having this issue. I have debugged as much as I can, and I can see that 5 and 1 are being passed into CommerceBuilder.Orders.BasketItemDataSource.CreateForProduct, with 5 being a valid product id. It works fine on my dev pc, but on the live server I get the null ref exception. I am using identical sites and identical databases. There is obviously some difference, but without being able to see inside the CommerceBuilder api I'm pretty stuck.
Any help would be much appreciated.
Kind regards
Rob
Any help would be much appreciated.
Kind regards
Rob