我已经创建了一个新的字段调用子名,这是一个帐户注册表单上的一个重要字段。无法将Magento 1.6商店注册页面上的自定义字段导入到mysql数据库中。
我:
新增形式进入register.phtml确定并显示在表格上。
把这个代码放到/local/Mage/Customer/etc/config.xml
<childname>
<create>1</create>
<update>1</update>
</childname>
将此添加到/local/Mage/Customer/Model/Resource/Setup.php
'childname' => array(
'type' => 'varchar',
'label' => 'Please Enter Childs Name',
'input' => 'text',
'required' => true,
'visible' => true,
我已经在eav_attribute表中添加了attribute_code子类名设置为varchar
我已经运行了注册页面并查看了customer_entity_varchar,但它没有被存储?
我错过了一些代码的地方,不知道哪个文件发送数据到数据库?
任何帮助将不胜感激!
在此先感谢
运行Magento的1.6
@OSDdave非常感谢,wheres最好的地方放这段代码? – Ledgemonkey
@Ledgemonkey最好的地方是app/code/local-or-community/YourNamespace/YourModule/sql/yourmodule_setup/mysql4-upgrade-0.1.0-0.1.1.php假设你的模块目前版本为0.1.0,而你的第一次安装将一行插入到core_resource中。但我并不完全确定,因为您对整个模块的信息很少。 – OSdave
再次非常感谢您的帮助,我使用本地/法师/客户 - sql/customer_setup mysql4-upgrade-1.6.0.0-1.6.1.0.php我应该在本地创建一个新模块吗? – Ledgemonkey