I have already created a custom layout for my Magento theme which works fine. The only issue I have so far is that my registration does absolutely nothing. I have tried searching but only seem to come up with results on how to add new fields to a registration page. My current code is as follows:
<div id="user-login">
<span class="log-head loginfield">
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
<h2>You Already Have An Account</h2>
<p>Please login with your e-mail and password</p>
<span>
<label>Enter your E-mail address:</label>
<input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
</span>
<span>
<label>Enter your password:</label>
<input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
</span>
<input class="submit" type="submit" value="Submit">
</form>
</span>
<span class="log-head registerfield">
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
<h2>You Don't Have An Account</h2>
<p>Please enter your information and create an account</p>
<span>
<label>Email Address:</label>
<input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
</span>
<span>
<label>Enter your password:</label>
<input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
</span>
<span>
<label>Re-Enter your password:</label>
<input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
</span>
<input class="submit" type="submit" value="Create Account">
</form>
<script type="text/javascript">
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
<?php if($this->getShowAddressFields()): ?>
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
<?php endif; ?>
//]]>
</script>
</span>
</div><!--/user-login -->
I combined the registration and login page to fit my design. The input fields are taken directly from the base theme. After I try to test and create a user the page just refreshes and the user is never created. The same goes if I create a user from the backend and try to login the page refreshes but never logs me in.
Any help will definitely be appreciated.
The reason you are have issue is because both forms are pointing to the same form action (assuming that the input names are the same as default magento)
This should Fix your issue
Change this (I not sure which block type you are using so i’m going to change both action)
to
Change this
to
If this doesn’t work then view page source and look where both form action is pointed (see below for location where they should point). Try changing the action to
Reason for Issue
By default magento sperate the registration and login form into 2 different pages which uses two different block
see /app/design/frontend/default/contempospace/layout/customer.xml (customer_account_create and customer_account_login)
Both block have a method getPostActionUrl() which point to different url /customer/account/loginPost/ and /customer/account/createpost/
See
You may want take a look at How Blocks And PHTML Work Together