2016-02-03 37 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> 
相關問題