Shopping Cart - Object reference not set to an instance of a

Posted by Community Admin on 05-Aug-2018 12:19

Shopping Cart - Object reference not set to an instance of an object.

All Replies

Posted by Community Admin on 19-Jun-2012 00:00

Hi,
I upgraded sitefinity 4.4 to 5.0. I have changed all manual settings which are described in sitefinity upgrade document. But still I am getting an error on Shopping cart control.
Please see below for more details.

Server Error in '/' Application.
 
Object reference not set to an instance of an object.
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
 
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.ShoppingCart.AttachEventsToCouponCodeControl(CouponCodeEntryView couponCodeEntryView) +62
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.ShoppingCart.InitializeControls(GenericContainer container) +1803
   Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +89
   System.Web.UI.Control.EnsureChildControls() +162
   System.Web.UI.Control.PreRenderRecursiveInternal() +120
   System.Web.UI.Control.PreRenderRecursiveInternal() +307
   System.Web.UI.Control.PreRenderRecursiveInternal() +307
   System.Web.UI.Control.PreRenderRecursiveInternal() +307
   System.Web.UI.Control.PreRenderRecursiveInternal() +307
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4838
 
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272


Thanks,
Tarun

Posted by Community Admin on 21-Jun-2012 00:00

Similar problem.  Just upgraded from 4.4 to the latest 5.x version.  After adding an item to the shopping cart, attempting to view the cart results in the following exception:
 

Server Error in '/NLGSitefinityWebApp' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.ShoppingCart.InitializeControls(GenericContainer container) +1452 Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +81 System.Web.UI.Control.EnsureChildControls() +181 System.Web.UI.Control.PreRenderRecursiveInternal() +59 System.Web.UI.Control.PreRenderRecursiveInternal() +221 System.Web.UI.Control.PreRenderRecursiveInternal() +221 System.Web.UI.Control.PreRenderRecursiveInternal() +221 System.Web.UI.Control.PreRenderRecursiveInternal() +221 System.Web.UI.Control.PreRenderRecursiveInternal() +221 System.Web.UI.Control.PreRenderRecursiveInternal() +221 System.Web.UI.Control.PreRenderRecursiveInternal() +221 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4200 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272


I just got done wasting a day wrestling with a stupid OpenAccess.targets issue and now this.  I'm now rounding the corner on 2 full days trying to get this site "upgraded" on my development machine.

Steve


Posted by Community Admin on 21-Jun-2012 00:00

Hi Steve,

May be this can help you.

I fixed it. In sitefinity 5x up-gradation some issue with CheckOut  Default templates.... that does not upgradated. So I created a fresh sitefinity 5x project and used Checkout's default template to my server app,just copy and paste and I found my issue fixed.

Thanks,
Tarun

Posted by Community Admin on 21-Jun-2012 00:00

Hi Steve,

Sorry, I lead you to wrong move. Actually previous solution was related to Checkout control...may be you need that later. But for you current issue. You need to replace one line in default template of Shopping Cart control.
New line:
 <orders:couponcodeentryview id="couponCodeEntryView" runat="server" /> 

Old line:
 <orders:couponcodeentryview runat="server" />

Thanks,
Tarun

Posted by Community Admin on 22-Jun-2012 00:00

Hi Tarun,

That pointed me in the right direction.

Thanks--Steve

Posted by Community Admin on 18-Jul-2012 00:00

Did everything work out here? I am getting the same error. Specifically the one below, after an upgrade to 5.1.   I have restored the template for the shopping as well.

Object reference not set to an instance of an object.
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
 
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.ShoppingCart.InitializeControls(GenericContainer container) +1685
   Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +58
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
 
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Posted by Community Admin on 18-Jul-2012 00:00

sorry - i just created a new page and put the shopping cart on it and it is working fine now.

Posted by Community Admin on 19-Jul-2012 00:00

Hi,

This is a known issue with the 5.1 upgrade. I have included a link to a KB article which explains how to resolve the issue with the shopping cart template.

Greetings,
Grace Hallwachs
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed