PHP Magento Tips

How to Remove Magento Redirection Page after Customer Logout

Rate this posting:
{[['']]}

In Magento, When customer logout Magento sets custom redirection logoutSuccess Page for 5 seconds. You can easily remove this process by creating Event for that.

Step 1:

in app/etc/modules/Mycompany_Removelogoutredirect.xml add below code:

<?xml version="1.0"?>
<config>
  <modules>
    <Mycompany_Removelogoutredirect>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
    </Mycompany_Removelogoutredirect>
  </modules>
</config>
  
Step 2: 

in app/code/local/Mycompany/Removelogoutredirect/etc/config.xml add below code:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_Removelogoutredirect>
            <version>0.1.0</version>
        </Mycompany_Removelogoutredirect>
    </modules>
    <global>
        <models>
            <mycompany_removelogoutredirect>
                <class>Mycompany_Removelogoutredirect_Model</class>
            </mycompany_removelogoutredirect>
        </models>
    </global>
    <frontend>
        <events>
            <controller_action_postdispatch_customer_account_logout><!-- event observer -->
                <observers>
                    <Mycompany_Removelogoutredirect>
                        <class>mycompany_removelogoutredirect/observer</class>
                        <method>logoutRedirect</method>
                    </Mycompany_Removelogoutredirect>
                </observers>
            </controller_action_postdispatch_customer_account_logout>
        </events>
    </frontend>
</config>

Step 3:

in  app/code/local/Mycompany/Removelogoutredirect/Model/Observer.php add below Code:

<?php

class Mycompany_Removelogoutredirect_Model_Observer {

    public function logoutRedirect(Varien_Event_Observer $observer){
        $observer->getControllerAction()->setRedirectWithCookieCheck('/');
        }
}

Tag : Magento
1 Comments On "How to Remove Magento Redirection Page after Customer Logout"

Where it will redirect after logging out, when we follow the steps you mentioned?

Back To Top