为Magento1.5新增会员注册字段(转)
第一步、新建一个模块,在app/etc/modules/目录下新建文件Shuishui_Customer.xml
<config>
<modules>
<Shuishui_Customer>
<active>true</active>
<codePool>community</codePool>
</Shuishui_Customer>
</modules>
</config>
第二步、新建这个模块的config配置文件,位置在app/code/community/Shuishui/Customer/etc/config.xml
<?xml version="1.0"?> <config>
<modules>
<Shuishui_Customer>
<version>0.1.</version>
</Shuishui_Customer>
</modules>
<global>
<fieldsets>
<customer_account>
<mobile><create></create><update></update></mobile>
</customer_account>
</fieldsets>
<models>
<Shuishui_Customer>
<class>Shuishui_Customer_Model</class>
</Shuishui_Customer>
</models>
<helpers>
<Shuishui_Customer>
<class>Shuishui_Customer_Helper</class>
</Shuishui_Customer>
</helpers>
<resources>
<customerattribute_setup>
<setup>
<module>Shuishui_Customer</module>
<class>Shuishui_Customer_Model_Entity_Setup</class>
</setup>
</customerattribute_setup>
</resources>
</global> </config>
第三步、新建一个model类,继承自Mage_Customer_Model_Entity_Setup类,类里新添加一个字段,位置在app/code/community/Shuishui/Customer/Model/Entity/Setup.php
class Fanxiang_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup
'created_at' => array(
'type' => 'static',
'label' => 'Created At',
'visible' => false,
'required' => false,
'input' => 'date',
),
'mobile' => array(
'type' => 'static',
'label' => 'Mobile',
'visible' => true,
'required' => false,
'sort_order' => ,
),
),
), 'customer_address'=>array(
'entity_model' =>'customer/customer_address',
'table' => 'customer/address_entity',
'additional_attribute_table' => 'customer/eav_attribute',
'entity_attribute_collection' => 'customer/address_attribute_collection',
第四步、新增一个数据库安装脚本文件,位置在app/code/community/Shuishui/Customer/sql/customerattribute_setup/mysql4-install-0.1.0.php
$installer = $this;
$installer->startSetup();
$installer->addAttribute('customer','mobile',array(
'label' => 'Mobile',
'visible'=>,
'required'=>,
'position'=>,
'sort_order'=>,
));
$installer->endSetup();
$customerattribute = Mage::getModel('customer/attribute')->loadByCode('customer','mobile');
$forms = array('customer_account_edit','customer_account_create','adminhtml_customer','checkout_register');
$customerattribute->setData('used_in_forms',$forms);
$customerattribute->save();
第五步,在前台注册页面的模板文件中添加一个新的表单项,位置在template\customer\form\register.phtml
<li>
<label for="mobile" class="required"><em>*</em><?php echo $this->__('mobile') ?></label>
<div class="input-box">
<input type="text" name="mobile" id="mobile" value="" title="<?php echo $this->__('mobile') ?>" class="input-text required-entry" />
</div>
</li>
前台显示效果

后台会员管理页面效果

PS:1.4版本同样适用
参见原文:http://mydons.com/how-to-add-custom-fields-to-customer-registration-and-account-page-in-magento-1-5/
为Magento1.5新增会员注册字段(转)的更多相关文章
- 10天学会phpWeChat——第十天:phpWeChat的会员注册、登录以及微信网页开发
通过前面的系列教程,我们系统的讲解了phpWeChat从视图端.控制器端到模型端的操作流程:熟悉了phpWeChat的目录结构:掌握了视图端模板如何创建一个丰富的表单和模型端如何操作数据库.这一切都是 ...
- MVC会员注册
自从写了<数据库数据加密与解密>http://www.cnblogs.com/insus/p/3434735.html.其中也有提及Insus.NET将要在MVC应用程序中实现会员注册的功 ...
- 第三百八十四节,Django+Xadmin打造上线标准的在线教育平台—路由映射与静态文件配置以及会员注册
第三百八十四节,Django+Xadmin打造上线标准的在线教育平台—路由映射与静态文件配置以及会员注册 基于类的路由映射 from django.conf.urls import url, incl ...
- 帝国cms实现会员注册之后根据所在会员组转向的方法
帝国cms要实现会员注册之后根据所在会员组转向的能能,就需要修改/e/member/class/member_registerfun.php文件找到第175行,修改成如下代码: //审核 if($ch ...
- 将ECSHOP会员注册页面的Email修改成非必填项
将ECSHOP会员注册页面的Email修改成非必填项 ECSHOP教程/ ecshop教程网(www.ecshop119.com) 2011-07-29 有人说,在后台的 “会员注册项设置 ”里面 ...
- DISCUZ! X2.5设置仅允许QQ登录注册论坛 加固会员注册机制
论坛稍微有点起色之后,很多站长就会担心论坛经常被人恶意灌水.注册机.顶贴机等等一些列非法的手段.通常站长都会通过一些后台的设置和插件等等一 切有效的方法预防,但更多的站长会通过限制用户注册会员,需注册 ...
- DEDECMS会员注册如何配置邮箱发送邮件功能
网站邮件功能是一个非常基础和有效的通信工具,配合dede会员注册邮件验证功能可以大量的拒绝垃圾注册用户.那么如何配置DEDECMS会员注册邮箱发送邮件功能? 1:配置dedecms网站发信EMAI ...
- 【MVC】会员注册/登录,普通验证,会员名是否注册Ajax验证以及会员邮件验证实现原理
using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentM ...
- web会员注册页面代码(4)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- (转)Unity Assets目录下的特殊文件夹名称(作用和是否会被打包到build中)
原文:http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder 1.隐藏文件夹以.开头的文件夹会被Uni ...
- Dapper - .Net 环境下一个简单对象映射的框架
本文内容 特点 性能 参数化的查询 List 支持 缓存和非缓存的 readers 多个映射 多个结果 存储过程 Ansi Strings 和 varchar 限制和注意事项 Dapper 能运行在我 ...
- Android 高级 Jackson Marshalling(serialize)/Unmarshalling(deserialize)
本文内容 高级 Jackson Marshalling 只序列化符合自定义标准的字段 把 Enums 序列化成 JSON 对象 JsonMappingException(没有找到类的序列化器) Jac ...
- 【树莓派】树莓派与XBMC及Kodi、LibreELEC插件(二)
之前的相关文章参考: [树莓派]树莓派与XBMC及Kodi.LibreELEC插件(一) [树莓派]树莓派与XBMC及Kodi.LibreELEC插件(二) [树莓派]树莓派与XBMC及Kodi.Li ...
- 第五周 Word注释与交叉引用
第五周 Word注释与交叉引用 教学时间 2013-3-26 教学课时 2 教案序号 4 教学目标 1.掌握脚注.尾注.题注的概念和应用 2.掌握交叉引用的操作方法 教学过程: 复习提问 1.如何利用 ...
- Go语言使用PostgreSQL数据库
Go语言使用PostgreSQL数据库 PostgreSQL和MySQL比较,它更加庞大一点,因为它是用来替代Oracle而设计的.所以在企业应用中采用PostgreSQL是一个明智的选择. 现在My ...
- SQL Server 2008——SQL命令INSERT
T-SQL的INSERT命令的语法: INSERT [INTO] {table_name|view_name} [{(column_name,column_name,-)}] ...
- EL和OGNL表达式的区分
OGNL是通常要结合Struts 2的标志一起使用,如<s:property value="#xx" /> struts页面中不能单独使用,el可以单独使用 ${ses ...
- JVM中java实例对象在内存中的布局
普通的Java对象实例 和 Java数组实例.Java数组实例的对象头多了一个数组的长度.Java虚拟机可以通过普通java对象的元数据来确定java对象的大小,但是从数组的元数据中却无法确定数组的 ...
- 〖Linux〗Shell十进制数值转换十六进制
dec2hex(){ printf } a=$(dec2hex ) echo $a