2016-02-03 39 views
0

我想用一些扩展名在Magento中创建表单。在表单底部,当用户按下提交按钮时,如果他还没有注册并登录,它应该将他重定向到“创建新帐户”页面。但是,如果他已经登录,他应该能够提交表格,并且表格应该自动包括他的账户的一些细节(例如用户名,姓名等)。我怎么能做到这一点,我应该使用哪种扩展形式?只有在已经登录的情况下才能在Magento中提交表格

+0

你应该阅读[问]。 – Enigmativity

回答

0

请查看以下表格行动

<?php $custmlogin= new Mage_Customer_Block_Form_Login();?> 
<form action="<?php echo $custmlogin->getPostActionUrl() ?>" method="post" id="login-form"> 
Email:<input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" title="<?php echo $this->__('Email Address') ?>" /> 
Password:<input type="password" name="login[password]" id="pass" title="<?php echo $this->__('Password') ?>" /> 
<button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button> 
</form> 
相关问题