0
votes

i'm trying since few day to change the redirection when a"customers" complete is registration on my magento website. Actually, when the registration is complete you are redirect to your account. And i just want to redirect to the index.php ( the homepage of my website). I'm a newbie and i just want to change few lines on code. I'll not able to creat event for exemple.

Can someone help me ?

I think the page is AccountController.php and code :

 protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer,     $isJustConfirmed = false)
    {
        $this->_getSession()->addSuccess(
        $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName())
        );

        $customer->sendNewAccountEmail(
            $isJustConfirmed ? 'confirmed' : 'registered',
            '',
            Mage::app()->getStore()->getId()
        );

        $successUrl = Mage::getUrl('/*/*/index', array('_secure'=>true));
        if ($this->_getSession()->getBeforeAuthUrl()) {
            $successUrl = $this->_getSession()->getBeforeAuthUrl(false);
        }
        return $successUrl;
    }

I've tried to change this line :

$successUrl = Mage::getUrl('/*/*/index', array('_secure'=>true));

to

$successUrl = Mage::getUrl('index.php', array('_secure'=>true));

but nothing happens...

2

2 Answers

0
votes

The Mage::getUrl() method is designed around the $module/$controller/$action of Magento routes. If you just want to redirect to the homepage, you could use:

$successUrl = Mage::getBaseUrl();
0
votes

Redirection after logged In, Logged Out and Registration is very common issue in magento. Please find the code below, it can help you.

public function customerRegistration(Varien_Event_Observer $observer)    
{    
    $_session = Mage::getSingleton('customer/session');  
    $_session->setBeforeAuthUrl(CustomUrl);    
}

Customurl is a url on which you want to redirect after registraion.

If you want complete solution for custom url redirection for your ecommerce website after logged In, Logged Out and Registration. Custom Redirection extension can help you. Click on link to get extension. http://www.magentocommerce.com/magento-connect/custom-redirection.html