Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 6 of 6

Thread: help with the continue shopping button {ML 8.0.1.2/8.0.1.2}

  1. #1
    Ismacdo is offline Junior Member
    Join Date
    Jun 2013
    Posts
    2

    Default help with the continue shopping button {ML 8.0.1.2/8.0.1.2}

    i searched the forums here and i googled the rest of the web nd no one seems to have a clear solution to fix this, i saw one post that explained in great detail how to go about changing this and making sure that when you hit the continue shopping button that it goes back to what the customer was just looking at however it was only for V-7.xxxx does anyone know if there is a fix to this to make the continue shopping button actually do what its supposed to do? setting a static URL is a waste of my customers time and kills the conversion ratio.....

    is there an easy way to fix this through the appconfig options? or do i have to hard code this option into one of the files? if so what one? im not experienced with the language this site uses since i just started working with asp.net storefront can some one assist me in ho i would go about fixing this issue?
    ML 8.0.1.2/8.0.1.2

  2. #2
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    I'm very interested in this also. Sometimes the continue shopping button works, sometimes it just redirects to the front page. Very frustrating.
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  3. #3
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    The main reason the continue shopping appears to only work some of the time is most likely the query string by the name of ReturnUrl is blank or not there.

    Also I think the thread you were talking about is this url correct? Those modifications should still work from what I can see. That is if you want the customer to go the category level instead. If you just want the customer to go back the last URL even when there is no query string then try editing shoppingcart.aspx.cs by looking for private void ContinueShopping() in the code. Then replace that code with:

    Code:
    private void ContinueShopping()
            {
                if (AppLogic.AppConfig("ContinueShoppingURL") == "")
                {
                    if (ViewState["ReturnURL"].ToString() == "")
                    {
                        if (Request.UrlReferrer.ToString().Contains(AppLogic.LiveServer()))
                        {
                            Response.Redirect(Request.UrlReferrer.ToString());
                        }
                        else
                        {
                            Response.Redirect("default.aspx");
                        }                    
                    }
                    else
                    {
                        Response.Redirect(ViewState["ReturnURL"].ToString());
                    }
                }
                else
                {
                    Response.Redirect(AppLogic.AppConfig("ContinueShoppingURL"));
                }
            }

  4. #4
    Ismacdo is offline Junior Member
    Join Date
    Jun 2013
    Posts
    2

    Default Still having issues...

    First off id really like to thank you Mc i was worried no one would be able to help me out with this...

    i tried entering the code snippit you sent over in your last message and now when i hit the continue shopping button, it takes me back to the shopping cart i was just in, so i dont know if i did something wrong or what but i replaced the code that was in there....

    Code:
    private void ContinueShopping()
            {
                if (AppLogic.AppConfig("ContinueShoppingURL") == "")
                {
                    if (ViewState["ReturnURL"].ToString() == "")
                    {
                        Response.Redirect("default.aspx");
                    }
                    else
                    {
                        Response.Redirect(ViewState["ReturnURL"].ToString());
                    }
                }
                else
                {
                    Response.Redirect(AppLogic.AppConfig("ContinueShoppingURL"));
                }
            }
    with the new code snippit you provided do you have any idea why it may still not be working?

    also i tried to edit my code for the fix that the gentleman provided in the link you refrenced, which was the one i was talking about but i was unable to find the file/code where he called for things to be replaced and so on maybe it was just a error with geany's ( the code editor i use) find function i will try to figure out what happened there and see if that fix works also!!

    once again thanks alot when i saw this as i came into work today i practically jumped out of my seat i was so excited lol
    ML 8.0.1.2/8.0.1.2

  5. #5
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    given the information you gave I would guess that a submission is being done on the shoppingcart.aspx page. When that submission is done the UrlReferrer is set the same page that you are currently viewing. Therefor it redirects back to shoppingcart.aspx.

    I haven't tested this fully locally yet so I can't give a workaround code. But my work around idea is basically be saving UrlReferrer to the session state or the view state. Then making sure the value you save does not save the value of shoppingcart.aspx in it. That way you would have the last UrlReferrer before for submissions to the page.

  6. #6
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    I was able to do some testing this morning and got the workaround working in my testing. Find this if statement
    Code:
    if (!this.IsPostBack)
    .
    Once there add the code below to the if statement.
    Code:
    if (Request.UrlReferrer != null)
                    {
                        if (!Request.UrlReferrer.ToString().ToLower().Contains("shoppingcart.aspx"))
                        {
                            ViewState["ReferrerURL"] = Request.UrlReferrer;
                        }
                    }
    Next replace ContinueShopping() with the code bellow.
    Code:
    private void ContinueShopping()
            {
                if (AppLogic.AppConfig("ContinueShoppingURL") == "")
                {
                    if (ViewState["ReturnURL"].ToString() == "")
                    {
                        if (ViewState["ReferrerURL"] != null)
                        {
                            if (ViewState["ReferrerURL"].ToString() == "")
                            {
                                Response.Redirect("default.aspx");
                            }
                            else
                            {
                                Response.Redirect(ViewState["ReferrerURL"].ToString());
                            }
                        }
                        else
                        {
                            Response.Redirect("default.aspx");
                        }
                    }
                    else
                    {
                        Response.Redirect(ViewState["ReturnURL"].ToString());
                    }
                }
                else
                {
                    Response.Redirect(AppLogic.AppConfig("ContinueShoppingURL"));
                }
            }
    The continue shopping should now try to use the last referred that is not shoppingcart.aspx. Please do keep in mind that there are cases where the customers browser can have the Refers disabled in the browser. If this is the case the only time the customer will go back to the same page is when the ReturnURL query string is there. It should be a rare case that Refers are disabled on a browser but still wanted to be clear there can still be a point were the customer will still return to homepage.