Close

Login Redirection

jkeeler
24 days ago
#16354 Quote
Avatar
  • 47
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.



jkeeler
23 days ago
#16357 Quote
Avatar
  • 47
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?
jkeeler
10 days ago
#16400 Quote
Avatar
  • 47
bump*
Boyko
3 days ago
#20875 Quote
Avatar
  • Moderator
  • 1445
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) {
                    updateLoginPopup(data);
                } else {
                   window.location.reload();
                }



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

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


Hope this helps!
Regards,
Boyko Stanev
Nop-Templates.com