0

This question already has an answer here:

This is my redirect function:

public function redirectCustom(Varien_Event_Observer $o)
    {
        Mage::app()->getResponse()->setRedirect("http://localhost/myurl/");
    }

This is my xml:

<frontend>
        <events>
            <customer_login>
                <observers>
                    <mynamespace_mymodule_customer_login>
                        <class>Mynamespace_Mymodule_Model_Observers_Customer_Redirect</class>
                        <method>redirectCustom</method>
                    </mynamespace_mymodule_customer_login>
                </observers>
            </customer_login>
</events>
    </frontend>

My xml is fine, it gets to my function. But it simply ignores my redirect to my custom url. After login it redirects me always to my account page and i want to redirect my user to a custom page. What's wrong with my redirect function. Any ideas ?

marked as duplicate by Qaisar Satti, Marius Sep 6 '16 at 10:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Have you changed these

enter image description here

Try the below code for redirection

if( !Mage::getSingleton( 'customer/session' )->isLoggedIn() )
{                  
    $this->_redirect('abc'); 
}

in Magento _redirect is function for page redirection. Apply your custom page url instead of using abc.

  • This field is set to NO. I tried your code, but it not works :( . Any other idea ? – Attila Naghi Sep 6 '16 at 10:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.