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.