跳转到主要内容
首页

用户帐户菜单

  • 登录

主导航

  • 首页
  • 小公司运营
  • 网站建设
  • 创业杂谈
  • 兼职赚钱
  • 小微企业信息化
  • 手册教程
    • 《大伟哥的Drupal 8建站指南》
    • 《通过JohnChow.Com在网上赚钱》
  • 关于

面包屑

  • 首页
  • 解决Magento版本1.9.1升级到1.9.2.4后新用户不能注册的问题

解决Magento版本1.9.1升级到1.9.2.4后新用户不能注册的问题

By 大伟哥 | 2017-02-08,周三, 22:46

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() ?>" / >

保存以后就问题就解决了。

网站建设
  • 448 阅读
Magento

添加新评论

此字段内容将保密,不会被其他人看见。
关于文本格式
  • 不允许使用HTML标签。
CAPTCHA
14 + 2 =
计算出这道简单的算术题并键入答案。例如、1+3,就输入 4。
发布评论前,请通过下面的验证,以免被当作垃圾评论机器人屏蔽。

搜索

沪ICP备17000093号-1

公安备案沪公网安备 31011402008254号

© 2016-2022 大伟哥博客版权所有