My customers can't log in to their account. When click log in on log-in page. It should be log in on their account but it redirects the same page. This problem arise after upgrade magento from 1.7 to 1.9
2 Answers
Rahul Shendge,Magento 1.9 have a feature the formkey.
In Magento 1.9,for account login,you need to pass form key and just send form key
Just add the code at loggin form
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
-
I tried but it doesn't work..– user21368Commented Feb 12, 2015 at 6:46
-
1Make sure you have hidden form_key fields in your form login. And also check if your Account login is overriden by some third party modules. Commented Feb 12, 2015 at 7:08
-
any other solutions??– user21368Commented Feb 12, 2015 at 10:19
If the login forms in the frontend do not work anymore after an update to Magento CE 1.8.1 or EE 1.13.1, the used theme has to be updated. These forms now need a form key, if it is missing, validation in the controller fails. The same applies for the “Update Cart” button in cart.phtml
. To fix it, change the templates persistent/customer/form/login.phtml
and persistent/checkout/onepage/login.phtml
of your theme and add the hidden form key block somewhere within the <form>
element:
<?php echo $this->getBlockHtml('formkey'); ?>
Of course it would be optimal, if the them overrides as little core templates as possible and does its changes with layout updates in [theme]/local.xml
and CSS wherever possible.
-
1<?php echo $this->getBlockHtml('formkey'); ?> I used this after <form> but it showing same result as before...– user21368Commented Feb 12, 2015 at 9:59
-
is it possible that your theme overrides
layout/core.xml
? Commented Feb 12, 2015 at 10:02 -
what action i have to do in that file???– user21368Commented Feb 12, 2015 at 10:05
-
As of Magento 1.8 it must contain this line (below
<default>
):<block name="formkey" type="core/template" template="core/formkey.phtml" />
. But it shouldn't have been overridden in the first place. You should check if it is the same as the original file in base/default from Magento 1.7 and if so, delete it from your theme. Commented Feb 12, 2015 at 10:08 -
1<block name="formkey" type="core/template" template="core/formkey.phtml" /> it is there in base/default folder. still get same output.– user21368Commented Feb 12, 2015 at 10:43