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

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

 Ecommerce

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

  • Shopping Cart - Object reference not set to an instance of an object.
  • 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

  • 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


  • 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
  • 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
  • Hi Tarun,

    That pointed me in the right direction.

    Thanks--Steve
  • 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
  • sorry - i just created a new page and put the shopping cart on it and it is working fine now.
  • 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