无法再在 Magento 1.4.2.0 中添加注册字段

Can no longer add registration fields in Magento 1.4.2.0(无法再在 Magento 1.4.2.0 中添加注册字段)
本文介绍了无法再在 Magento 1.4.2.0 中添加注册字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我之前已经将本教程用于 将注册字段添加到 Magento 注册页面.

I have used this tutorial before for adding registration fields to the Magento registration page.

它一直有效,但自从我升级到 Magento 1.4.2.0 后,它就不再有效了.我添加的属性不再像以前那样显示在后端的客户信息选项卡下,并且不会被保存.不过,这些属性可以很好地安装到数据库中.我想可能 config.xml 部分已经更改,但我针对核心客户进行了检查,并且属性仍然以相同的方式显示:

It has always worked, but since I have upgraded to Magento 1.4.2.0 it no longer does. The attributes I add no longer show up under the customers information tab in the backend like it did before and are not getting saved. The attributes install into the database fine though. I thought maybe the config.xml part had changed but I checked it against the core customer one and the attributes are sill shown the same way:

<flavour><create>1</create><update>1</update></flavour>

自上次 1.4.2 测试版以来肯定发生了一些变化,因为它当时运行良好.如果有人有任何想法,将不胜感激,我终于可以睡一觉了!提前致谢!

Something must have changed since the last 1.4.2 beta because it worked fine then. If someone has any ideas it would be greatly appreciated and I could finally get some sleep! Thanks in advance!

推荐答案

我一直在为这个问题苦苦挣扎,直到我弄明白了.从 1.4.2 开始,要在管理员客户表单中显示的属性必须在表 customer_form_attribute 中.
您可以使用以下代码在模块设置中通过升级添加它们:

I have been struggling with this one quite some time untill I figured it out. Since 1.4.2, the attributes to show in the admin's customer's form have to be in table customer_form_attribute.
You can add them with an upgrade in your module's setup, with this code:

$eavConfig = Mage::getSingleton('eav/config');
$attribute = $eavConfig->getAttribute('customer', 'your_attributes_code');
$attribute->setData('used_in_forms', array('adminhtml_customer'));
$attribute->save();

希望有所帮助.

这篇关于无法再在 Magento 1.4.2.0 中添加注册字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

In PHP how can you clear a WSDL cache?(在 PHP 中如何清除 WSDL 缓存?)
failed to open stream: HTTP wrapper does not support writeable connections(无法打开流:HTTP 包装器不支持可写连接)
Stop caching for PHP 5.5.3 in MAMP(在 MAMP 中停止缓存 PHP 5.5.3)
Caching HTTP responses when they are dynamically created by PHP(缓存由 PHP 动态创建的 HTTP 响应)
Memcached vs APC which one should I choose?(Memcached 与 APC 我应该选择哪一个?)
What is causing quot;Unable to allocate memory for poolquot; in PHP?(是什么导致“无法为池分配内存?在 PHP 中?)