我已经为我的 Magento 主题创建了一个自定义布局,效果很好。到目前为止,我唯一的问题是我的注册完全没有任何作用。我尝试过搜索,但似乎只找到了有关如何将新字段添加到注册页面的结果。我目前的代码如下:
<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 -->
我结合了注册和登录页面以适合我的设计。输入字段直接取自基本主题。在我尝试测试并创建用户之后,页面只是刷新并且永远不会创建用户。如果我从后端创建一个用户并尝试登录页面刷新但从不登录我也是如此。
任何帮助都将不胜感激。