How to Create Pop-Up Window for Forgot Password

password-recovery

I was try to create pop-up for forgotten password.
I am able to open pop-up window, but there is whole site, instead of only form – it is because I call link for whole site like this:

<?php echo $this->getForgotPasswordUrl() ?>

Have anybody idea, how to load to pop-up only form?
I also try to call template of that form, but I got restriction.
So simple I use same call for pop-up here is it:

<a href="#" onclick="getForgotPassUrl('<?php echo $this->getForgotPasswordUrl() ?>')" class="pull-right"><?php echo $this->__('Forgot Your Password?') ?></a>

and here is js:

<script type="text/javascript">// <![CDATA[
function getForgotPassUrl(url) {
renewPassword = new Window({className:'magento',title:'Renew Password',url:url,width:820,height:600,minimizable:false,maximizable:false,showEffectOptions:{duration:0.4},hideEffectOptions:{duration:0.4}});
renewPassword.setZIndex(100);
renewPassword.showCenter(true);
}
// ]]></script>

Now I recognize, that after I confirm resend password, it redirect me to account page, but in this pop-up… best should be close pop-up.

Best Answer

To show only the form into the page (without the full layout) you need to set the template for the forgot password page to empty, this can be done thru the following code into your local.xml (inside your theme layout directory):

<customer_account_forgotpassword>
    <reference name="root">
        <action method="setTemplate"><template>page/empty.phtml</template></action>
    </reference>
</customer_account_forgotpassword>

To make the popup close you should add some javascript to the forgot form to submit to the opener window and close the popup, I will have to try it tomorrow on my dev system to see what would work.

Related Topic