I put a mini-login block in the left column of home. But when I am trying to log-in from there, it takes me to the log-in page with no errors.

In my search, I have seen that we should use a variable form_key, but I am not sure about where should I place it.

Here is my code i put in \app\design\frontend\base\default\layout\customer.xml

    <reference name="left">
        <block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>

form_key should go in your customer/form/mini.login.phtml file.

<?php $formKey = Mage::getSingleton('core/session')->getFormKey();?>
<input type="hidden" name="form_key" value="<?php echo $formKey; ?>" />
| improve this answer | |
  • where exactly i should put this code? i must replace certain code ? also i need to add the "form_key" on my block? – Yaren Sep 2 '15 at 1:34
  • 1
    nvm i am a dork it should be placed inside the <form action="<?php echo $this->getPostActionUrl() ?>" method="post"> ..... </form> before the block-content. Thx for the answer! – Yaren Sep 2 '15 at 1:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.