Magento – redirect users to login to specific page

Picture

Generally in the Magento backend under System > Configuration > Customer / Customer configuration > Logon options are stored, whether the customer is to be conducted after the successful login to his account or to remain on the site where it was before the login.

However, this may turn out to be difficult especially if you like an extension e.g may. Members Only Catalog used by power workers. Here you will then always passed on to the user account.

you can here on the back end in the standard not counteract.

A small interference in the files is necessary. Most sensible thing would be to write a small module, which overrides the following controller (and also very difficult!), otherwise remains only the engagement into a core file.

It's about the file AccountController.php in the directory app / code / core / Mage / Customer / controllers.

Here, the line provides (that.) 184 for forwarding after successful login. In the standard, this is

$this->_loginPostRedirect();

Now you can change it as desired. Is to be conducted after registration for the home side, change the line in

$this->_redirect(‘/’);

but you can also use other targets. For the imprint (can be contacted at www.domain.de//index.php/impressum/ ) e.g..

$this->_redirect(‘impressum’);

It is important not / Send to.

As I said,, a module for this purpose should be written, Unfortunately, a simple copy in app / code / local / Mage / Customer / controllers is not enough, because controllers are not loaded automatically, if they are in the local directory.

Used in Magento Version 1.9 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *