You are viewing an old revision of this post, from November 25, 2015 @ 16:33:35. See below for differences between this version and the current revision.

Redirecting to the last page after customer login magento

On a current project, I had a requirement to redirect to the homepage once a user successfully logs in to their account. I tried a few plugins to no avail, so had a go doing it myself. Obviously Magento by default, redirects to the customers Account page although there is a setting in the admin to turn this off. However, this resorts back to redirecting the user to the previous page, ie the referred page. You should set to "NO on "System > Configuration > Customers > Customer Configuration > Login Options" and in yours "login.phtml" files (both, "persistent/customer/form" and "customer/form" on your template folder) you must change the action of your to:
    action="<?php echo str_replace('login', 'loginPost', $this->helper('customer')->getLoginUrl()) ?>"
 

Revisions

  • November 25, 2015 @ 16:33:35 [Current Revision] by admin
  • November 25, 2015 @ 16:33:35 by admin

Revision Differences

There are no differences between the November 25, 2015 @ 16:33:35 revision and the current revision. (Maybe only post meta information was changed.)

No comments yet.

Leave a Reply