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

2022-10-21php开发问题
1

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

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17