Login Redirection

8 months ago
#16354 Quote
  • 49
When a customer logs into the website, they always get redirected to the home page. I am trying to modify this so that once they login, they are then redirected to the /customer/info page of their account.  I have read in some forms this was a theme issue not a nopcommerce issue but I am not sure how to fix this.

I tried all these calls in the customercontroller.cs file:

//   return RedirectToRoute("CustomerInfo", new { controller = "Customer", action = "Info" });
//   return Redirect("customer/info");
//   return RedirectToRoute("customerinfo", new { action = "Info" });
//   return Response.RedirectToRoute("CustomerInfo");

they all invoke info customer call and view
but in all efforts, the redirect to the home page gets invoked

I also have modified info.cshtml
@using (Html.BeginForm("Info","Customer",FormMethod.Post, new { data_ajax = "false" }))

But still no luck at all.  Any assistance would be appreciated.

8 months ago
#16357 Quote
  • 49
Ok just a follow up on this, I have disabled the "popup login" setting in the theme and it seems to work now with my changes done in the customercontroller.cs file.  Is there a way to make this work with the popup login option enabled?
7 months ago
#16400 Quote
  • 49
7 months ago
#20875 Quote
  • Moderator
  • 1495
Hi jkeeler,

Please note that the Loin popup uses Ajax calls to make the login.
So you need to make the redirect in the javascript instead.
Currently if the login is successful we simply reload the current page.
If you want to redirect to a specific page you need to change that code.
In the Pavilion.js file you need to find this function handleLoginModalPopup and change this line of code:

if (dataObj.find('#login-modal-window-static-resources').length > 0) {
                } else {

You need to change the code in Bold with something like this:

window.location.href = "https://your-new-location";

Hope this helps!
Boyko Stanev