无法再在Magento 1.4.2.0中添加注册字段 [英] Can no longer add registration fields in Magento 1.4.2.0

查看:52
本文介绍了无法再在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中添加注册字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆