Magento从1.9.2.1版本升级到1.9.2.4之后,当时看上去没有异常,不过后来测试的时候,发现没办法创建新的用户了,也就是说,新用户注册的功能是不可用的!
这个问题可严重了,大伟哥试了好多方法都没能解决。后来搜索到这么一篇文章:
If you cannot create a customer or login after applying patch SUPEE-6788 or upgrading to Magento 1.9.2.2 or later, this might be caused by missing form keys.
Make sure to add form keys to all of your (custom) template files:
In app/design/frontend/[package]/[theme]/template/customer/form/register.phtml and app/design/frontend/[package]/[theme]/template/persistent/customer/form/register.phtml
Add
< input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" / >
after
< input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" / >
就是说,在你的两个模板文件 app/design/frontend/[package]/[theme]/template/customer/form/register.phtml 和app/design/frontend/[package]/[theme]/template/persistent/customer/form/register.phtml 里,找到这行代码:
< input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" / >
在这行代码后面加上下面这行代码:
< input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" / >
保存以后就问题就解决了。
- 438 阅读
添加新评论