I am trying to display Login form in a pop-up window on a home page.
I am displaying pop-up using Fancybox2. That is working fine.
To display Login Form, I have used
<?php echo $this->getLayout()->createBlock('customer/form_login')->setTemplate('customer/form/mini.login.phtml')->toHtml();
?>
this code.
Above code is displaying Login Form. But when I enter correct or wrong details, it redirects to my-domain/index.php/customer/account/login/
page. On that page also I have displayed Login as well as register forms . On this page also Login Form doesn't work. It redirects to the same page.
For registration form, I have used
echo $this->getLayout()->createBlock('customer/form_register')->setTemplate('customer/form/register.phtml')->toHtml();
this code and It is working fine.
Below is the code from template/persistent/customer/form/login.phtml :
<div id="login_checkout" class="checkout-login">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div id="tabs">
<ul class="login_tabs">
<li><a href="#" class="current"><?php echo $this->__('Log in') ?></a></li>
<li><a href="#"><?php echo $this->__('Sign Up') ?></a></li>
</ul>
<div id="panes_login">
<div id="tabs-1">
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
<?php echo $this->getBlockHtml('formkey'); ?>
<ul class="form-list">
<li>
<div class="input-box">
<input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" placeholder="Email Address" />
</div>
</li>
<li>
<div class="input-box">
<input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" placeholder="Password" />
</div>
</li>
<li>
<div class="input-box">
<button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
</div>
</li>
<?php echo $this->getChildHtml('form.additional.info'); ?>
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
</ul>
<div class="forgat-pass">
<div class="stay_signin">
<input type="checkbox" id="stay_signin"><label for="stay_signin">Stay signed in</label>
</div>
<!--<a href="#forget_pass_popup" class="forget_pass_popup f-left">I forgot my password</a>-->
<a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left forgot-password forget_pass_popup"><?php echo $this->__('Forgot Your Password?') ?></a>
</div>
</form>
<div class="social-login">
<div class="or"><span>Or</span></div>
<p>Sign in with</p>
<!--<a class="google-login" href="#">Google</a>
<a class="facebook-login" href="#">Facebook</a>-->
<?php echo $this->getLayout()->createBlock('inchoo_socialconnect/google_button')->setTemplate('inchoo/socialconnect/google/button.phtml')->toHtml(); ?>
<?php echo $this->getLayout()->createBlock('inchoo_socialconnect/facebook_button')->setTemplate('inchoo/socialconnect/facebook/button.phtml')->toHtml(); ?>
</div>
</div>
<div id="tabs-2">
<?php echo $this->getChildHtml('customer_form_register'); ?>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
var dataForm = new VarienForm('login-form', true);
//]]>
</script>
</div>
</div>