in

dashCommerce

An ASP.NET Open Source e-Commerce Application

Shopping Cart Lost After Login on HTTPS

Last post 04-17-2008 1:43 AM by sonesh. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-12-2008 4:08 PM

    • tafs7
    • Top 150 Contributor
    • Joined on 02-12-2008
    • Dallas, TX
    • Posts 7

    Shopping Cart Lost After Login on HTTPS

    Since i can't get to the old posts from the previous forum, I'll repost this and hope someone can help.

    I set up a website that implements dashCommerce, but when users go to login in order to checkout, they lose their cart sessions (e.g., shopping cart shows as empty).  The Checkout.aspx page in dashCommerce performs a check to make sure it's a secure connection (HTTPS), if not it "rewrites" the URL by changing the scheme.

    I have a dedicated SSL certificate, and I have ensured that the domain for both HTTP and HTTPS are the same, so I am not sure why the user's shopping cart doesn't get migrated to the authenticated session.

     Any ideas, anyone?

    Regards,
    Thiago Silva
    Filed under: , , , ,
  • 02-13-2008 2:49 PM In reply to

    Re: Shopping Cart Lost After Login on HTTPS

    Thats an old problem with dashComerce nothing with ssl it happens when the user has once logged in and has added something to his cart then deleted all the stuff from the cart

    I posted a patch on codeplex

    But you will have to change this back to the old code (the patch uses SubSonic 2.1 beta)

    public static int GetCartOrderID(string userName) {
         int iOut = 0;
       //get the current order for the user. if there isn't one, make one
       Query q = new Query(Order.GetTableSchema());
       q.AddWhere("userName", userName);
       q.AddWhere("orderStatusID", (int)OrderStatus.NotProcessed);
    +   q.OrderBy("orderID","DESC")

       q.SelectList = "orderID";

      object oResult = q.ExecuteScalar();
      if (oResult != null) {
        iOut = (int)oResult;
       }
         return iOut;
     
       }

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 02-13-2008 5:54 PM In reply to

    • tafs7
    • Top 150 Contributor
    • Joined on 02-12-2008
    • Dallas, TX
    • Posts 7

    Re: Shopping Cart Lost After Login on HTTPS

    thanks.  What do you mean by changing it back to the old code?

    Regards,
    Thiago Silva
  • 02-13-2008 6:23 PM In reply to

    Re: Shopping Cart Lost After Login on HTTPS

    I created that patch after I created a patch to make dashCommerce 2.2 work with the latest version of SubSonic so I used some cool new feature of SubSonic that is still in beta and to use it you will have to patch your source with that patch also and that needs some more testing.

    So thats the code thats is there before you apply the patch with one modification is Ordering it in a DESC order.

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 02-29-2008 3:13 PM In reply to

    • danroberts
    • Top 50 Contributor
    • Joined on 02-11-2008
    • Kannapolis, NC (Charlotte)
    • Posts 18

    Re: Shopping Cart Lost After Login on HTTPS

    If you don't want to upgrade to SubSonic Beta or  delete code etc. you can simply put this in place of the old one in the

    App_Code\Business Logic\ordercontroller.cs

    This fixed the problem with the Shopping Cart getting lost after login.

     

    public static int GetCartOrderID(string userName)

    {

    int iOut = 0;

    //get the current order for the user. if there isn't one, make one

    Query q = new Query(Order.GetTableSchema());

    q.AddWhere("userName", userName);

    q.AddWhere("orderStatusID", (int)OrderStatus.NotProcessed);

    //q.OrderBy("orderid desc");

    q.OrderBy = SubSonic.OrderBy.Desc("orderID");

    q.SelectList = "orderID";

    object oResult = q.ExecuteScalar();if (oResult != null)

    {

    iOut = (
    int)oResult;

    }

    return iOut;

    }

    Dan
    www.chezamour.com
    www.digitalrcs.com
  • 04-17-2008 1:43 AM In reply to

    • sonesh
    • Not Ranked
    • Joined on 02-22-2008
    • Posts 1

    Re: Shopping Cart Lost After Login on HTTPS

    Thanks a lot.You made my day.I was looking for a solution from long time.

Page 1 of 1 (6 items)