Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Don't save order until payment is processed, shopping cart is locked View modes: 
User avatar
Member
Member
trheath@pilotcat.com - 8/31/2012 1:44:10 PM
   
Don't save order until payment is processed, shopping cart is locked
Greetings --

I've inherited a Kentico E-Commerce project from a previous developer and I'm trying to make some modifications. Currently when an order is placed it is saved to the database and marked as paid even though no payment information has been entered. Is there a way to fix this using the built GUI for Kentico? I have no problem modifying C# code if required.

Also, once the user has activated the payment method screen, if they return the store, the checkout seems to lock the shopping cart down and they can't return to the checkout screen. How do I fix this?

Thank you for any help,

Tim

User avatar
Member
Member
trheath@pilotcat.com - 8/31/2012 2:38:39 PM
   
RE:Don't save order until payment is processed, shopping cart is locked
Error in: http://localhost/Store/CMSPages/PortalTemplate.aspx?aliaspath=/SpecialPages/ShoppingCart
User Host: ::1
Exception of type 'System.Web.HttpUnhandledException' was thrown.

You are on Debug Mode.

Stack Trace:System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at CMS.SettingsProvider.BaseInfo.get_ObjectClassName() at CMS.CMSHelper.HandlerCompatibility.Object_Delete_Before(Object sender, ObjectEventArgs e) at CMS.SettingsProvider.CMSHandler`2.RaiseBefore(ArgsType e) at CMS.SettingsProvider.CMSHandler`2.RaiseBefore(ArgsType e) at CMS.SettingsProvider.CMSHandler`2.RaiseBefore(ArgsType e) at CMS.SettingsProvider.CMSHandler`2.StartEvent(ArgsType e, Boolean allowEvent) at CMS.DataEngine.AbstractInfo`1.DeleteData(Boolean logObjectChange) at CMS.Synchronization.SynchronizedInfo`1.DeleteData(Boolean logObjectChange) at CMS.DataEngine.AbstractInfoProvider`2.DeleteInfo(InfoType infoObj) at CMS.Ecommerce.ShoppingCartItemInfoProvider.DeleteShoppingCartItemInfoInternal(ShoppingCartItemInfo itemObj) at CMS.Ecommerce.ShoppingCartInfoProvider.EmptyShoppingCartInternal(ShoppingCartInfo cartObj) at CMSModules_Ecommerce_Controls_ShoppingCart_ShoppingCartContent.btnEmpty_Click1(Object sender, EventArgs e) in c:\projects\Store\CMSModules\Ecommerce\Controls\ShoppingCart\ShoppingCartContent.ascx.cs:line 415 at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 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.cmspages_portaltemplate_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\store\5460cf53\c607e6c5\App_Web_j0vzg2gk.10.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 9/3/2012 3:08:52 AM
   
RE:Don't save order until payment is processed, shopping cart is locked
Hello,


We cannot say exactly, where you set up the order status in your custom code. In the default check-out process, we save the order to the database when you click the ‘Order now’ button. In code:

~\CMSModules\Ecommerce\Controls\ShoppingCart\ShoppingCartPreview.ascx.cs

I would recommend to check the code where you save the order because by default the order is not marked as paid in the built-in check-out process.

Also check the payment methods in CMSDesk -> E-commerce -> Configuration -> Payment methods -> edit -> Order status when payment …

Then you can also check the code of payment methods how it updates the order when payment fails/succeeds.

Regarding the return from payment screen: The built-in check-out process saves the order before the payment step (when you click the order button). It also throws away the current shopping cart (since it is saved to a new order). The Payment step usually updates the order status and IsPaid flag of the new order.

As you can see, if you click Back in the payment step, it cannot load the previous shopping cart if you understand the current system. You can write a completely custom logic in the check-out steps, see: Customizing the purchase process and the following article.


Best regards,
Helena Grulichova