phpmagentomagento-1.6magento-1.7

How to give forgot password link from home page in Magento?


I have created a new template phtml file 2columns-right-home.phtml for home page of my Magento site. I want to give login form here. Also the links like 'create new account', 'Forgot Password', etc. How to give the links?

I tried the following:

<a href="<?php echo $this->getForgotPasswordUrl() ?>">Forgot password?</a>

But the page is not directing to the link.


Solution

  • Use the getUrl function to get the link to the forgotpassword action for the account controller of the customer module (whose frontName happens to also be customer, read more). As so:

    <a href="<?php echo Mage::getUrl('customer/account/forgotpassword') ?>">Forgot password?</a>
    

    More info on getUrl