{"id":9255,"date":"2012-11-29T18:13:31","date_gmt":"2012-11-29T12:43:31","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=9255"},"modified":"2012-11-30T14:16:57","modified_gmt":"2012-11-30T08:46:57","slug":"9255","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/9255\/","title":{"rendered":"Redirect customer after login in Magento"},"content":{"rendered":"<p>\nWhen customers sign in magento they will redirect to account&#8217;s dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding .\n<\/p>\n<p>\nFirst step is, create a custom module &#8220;local\/Intell\/Customer&#8221; and override &#8220;AccountController&#8221; of core customer module to your custom module. Following will be the content of your module&#8217;s config.xml file (local\/Intell\/Customer\/etc\/config.xml):\n<\/p>\n<p>[php]<br \/>\n&lt;?xml version=&quot;1.0&quot;?&gt;<br \/>\n&lt;config&gt;<br \/>\n    &lt;modules&gt;<br \/>\n        &lt;Intell_Customer&gt;<br \/>\n            &lt;version&gt;1.1.0&lt;\/version&gt;<br \/>\n        &lt;\/Intell_Customer&gt;<br \/>\n    &lt;\/modules&gt;<br \/>\n    &lt;frontend&gt;<br \/>\n        &lt;routers&gt;<br \/>\n            &lt;customer&gt;<br \/>\n                &lt;args&gt;<br \/>\n                    &lt;modules&gt;<br \/>\n                        &lt;intell_customer before=&quot;Mage_Customer&quot;&gt;Intell_Customer&lt;\/intell_customer&gt;<br \/>\n                    &lt;\/modules&gt;<br \/>\n                &lt;\/args&gt;<br \/>\n            &lt;\/customer&gt;<br \/>\n        &lt;\/routers&gt;<br \/>\n    &lt;\/frontend&gt;<br \/>\n    &lt;global&gt;<br \/>\n        &lt;helpers&gt;<br \/>\n            &lt;intell&gt;<br \/>\n                &lt;class&gt;Intell_Customer_Helper&lt;\/class&gt;<br \/>\n            &lt;\/intell&gt;<br \/>\n        &lt;\/helpers&gt;<br \/>\n    &lt;\/global&gt;<br \/>\n&lt;\/config&gt;<\/p>\n<p>[\/php]<\/p>\n<p>\nController function responsible for customer redirection after login is &#8220;_loginPostRedirect &#8220;. Override this function to your custom account controller. Following is the code of custom account controller (local\/Intell\/Customer\/controllers\/AccountController.php). In this code &#8220;$customerRedirectUrl &#8221; contains yourcustom page url :\n<\/p>\n<p>[php]<br \/>\n&lt;?php<br \/>\nrequire_once &#8216;Mage\/Customer\/controllers\/AccountController.php&#8217;;<br \/>\nclass Intell_Customer_AccountController extends Mage_Customer_AccountController<br \/>\n{<br \/>\n        protected function _loginPostRedirect()<br \/>\n   \t {<br \/>\n\t\t\/\/customer session<br \/>\n\t\t$session = $this-&gt;_getSession();<br \/>\n\t\t$preUrl = $session-&gt;getBeforeAuthUrl(true);<br \/>\n\t\t$cusromerRedirectStatus = 1;<br \/>\n\t\t\/\/your custom url<br \/>\n\t\t$customerRedirectUrl = &quot;customer\/address\/new&quot;;<br \/>\n\t\t$redirectUrl = $preUrl;<br \/>\n\t\tif(($cusromerRedirectStatus) &amp;&amp; ($customerRedirectUrl) &amp;&amp; ($session-&gt;getCustomerRedirectFlag()) &amp;&amp; (strpos($preUrl, &#8216;checkout\/onepage&#8217;) == &#8221;)){<br \/>\n\t\t\t$redirectUrl = Mage::getUrl().$customerRedirectUrl;<br \/>\n\t\t}<br \/>\n\t\tif(($cusromerRedirectStatus) &amp;&amp; ($customerRedirectUrl)){<br \/>\n\t\t\t$redirectUrl = Mage::getUrl().$customerRedirectUrl;<br \/>\n\t\t}<br \/>\n        if ($this-&gt;_getSession()-&gt;isLoggedIn()) {<br \/>\n            $this-&gt;_redirectUrl($redirectUrl);<br \/>\n            return;<br \/>\n        }<br \/>\n        $this-&gt;_redirectUrl($preUrl);<br \/>\n    }<br \/>\n}<\/p>\n<p>[\/php]<\/p>\n<p>\nLast step is, create a helper (local\/Intell\/Customer\/Helper\/Data.php) :\n<\/p>\n<p>[php]<br \/>\n&lt;?php<br \/>\nclass Intell_Customer_Helper_Data extends Mage_Core_Helper_Abstract<br \/>\n{<br \/>\n}<\/p>\n<p>[\/php]<\/p>\n<p>\nAnd yes, add your module&#8217;s pool file in app\/etc\/modules<br \/>\n<br \/>\nThat&#8217;s it. Hope this will help you.<br \/>\n\n<\/p>\n<p>\n<br \/>\nRegards,<br \/>\nAmatya Trivedi<br \/>\namatya@intelligrape.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When customers sign in magento they will redirect to account&#8217;s dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a [&hellip;]<\/p>\n","protected":false},"author":62,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":7,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9255","post","type-post","status-publish","format-standard","hentry","category-technology"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"When customers sign in magento they will redirect to account&#039;s dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"amatya\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/9255\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Redirect customer after login in Magento | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"When customers sign in magento they will redirect to account&#039;s dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/9255\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Redirect customer after login in Magento | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"When customers sign in magento they will redirect to account&#039;s dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#article\",\"name\":\"Redirect customer after login in Magento | TO THE NEW Blog\",\"headline\":\"Redirect customer after login in Magento\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2012-11-29T18:13:31+05:30\",\"dateModified\":\"2012-11-30T14:16:57+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":5,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#webpage\"},\"articleSection\":\"Technology\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#listItem\",\"name\":\"Redirect customer after login in Magento\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#listItem\",\"position\":3,\"name\":\"Redirect customer after login in Magento\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/\",\"name\":\"amatya\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98bb25c159475972796bfc713a7342c003e4b5ec97c0405283e939843153e6ee?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"amatya\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/\",\"name\":\"Redirect customer after login in Magento | TO THE NEW Blog\",\"description\":\"When customers sign in magento they will redirect to account's dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/9255\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\"},\"datePublished\":\"2012-11-29T18:13:31+05:30\",\"dateModified\":\"2012-11-30T14:16:57+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Redirect customer after login in Magento | TO THE NEW Blog","description":"When customers sign in magento they will redirect to account's dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a","canonical_url":"https:\/\/www.tothenew.com\/blog\/9255\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/9255\/#article","name":"Redirect customer after login in Magento | TO THE NEW Blog","headline":"Redirect customer after login in Magento","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2012-11-29T18:13:31+05:30","dateModified":"2012-11-30T14:16:57+05:30","inLanguage":"en-US","commentCount":5,"mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/9255\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/9255\/#webpage"},"articleSection":"Technology"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/9255\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/www.tothenew.com\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/9255\/#listItem","name":"Redirect customer after login in Magento"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/9255\/#listItem","position":3,"name":"Redirect customer after login in Magento","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/","name":"amatya","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/9255\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/98bb25c159475972796bfc713a7342c003e4b5ec97c0405283e939843153e6ee?s=96&d=mm&r=g","width":96,"height":96,"caption":"amatya"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/9255\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/9255\/","name":"Redirect customer after login in Magento | TO THE NEW Blog","description":"When customers sign in magento they will redirect to account's dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/9255\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author"},"datePublished":"2012-11-29T18:13:31+05:30","dateModified":"2012-11-30T14:16:57+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Redirect customer after login in Magento | TO THE NEW Blog","og:description":"When customers sign in magento they will redirect to account's dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a","og:url":"https:\/\/www.tothenew.com\/blog\/9255\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Redirect customer after login in Magento | TO THE NEW Blog","twitter:description":"When customers sign in magento they will redirect to account's dashbord page by default. There is no setting in magento which will let you to set your own landing page for customer after login. If you want to achieve this feature then you need to do some custom coding . First step is, create a","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"9255","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 07:18:19","updated":"2024-02-29 10:28:24","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRedirect customer after login in Magento\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Technology","link":"https:\/\/www.tothenew.com\/blog\/category\/technology\/"},{"label":"Redirect customer after login in Magento","link":"https:\/\/www.tothenew.com\/blog\/9255\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=9255"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9255\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=9255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=9255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=9255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}