第一步、新建一个模块,在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新增会员注册字段(转)的更多相关文章

  1. 10天学会phpWeChat——第十天:phpWeChat的会员注册、登录以及微信网页开发

    通过前面的系列教程,我们系统的讲解了phpWeChat从视图端.控制器端到模型端的操作流程:熟悉了phpWeChat的目录结构:掌握了视图端模板如何创建一个丰富的表单和模型端如何操作数据库.这一切都是 ...

  2. MVC会员注册

    自从写了<数据库数据加密与解密>http://www.cnblogs.com/insus/p/3434735.html.其中也有提及Insus.NET将要在MVC应用程序中实现会员注册的功 ...

  3. 第三百八十四节,Django+Xadmin打造上线标准的在线教育平台—路由映射与静态文件配置以及会员注册

    第三百八十四节,Django+Xadmin打造上线标准的在线教育平台—路由映射与静态文件配置以及会员注册 基于类的路由映射 from django.conf.urls import url, incl ...

  4. 帝国cms实现会员注册之后根据所在会员组转向的方法

    帝国cms要实现会员注册之后根据所在会员组转向的能能,就需要修改/e/member/class/member_registerfun.php文件找到第175行,修改成如下代码: //审核 if($ch ...

  5. 将ECSHOP会员注册页面的Email修改成非必填项

    将ECSHOP会员注册页面的Email修改成非必填项 ECSHOP教程/ ecshop教程网(www.ecshop119.com) 2011-07-29   有人说,在后台的 “会员注册项设置 ”里面 ...

  6. DISCUZ! X2.5设置仅允许QQ登录注册论坛 加固会员注册机制

    论坛稍微有点起色之后,很多站长就会担心论坛经常被人恶意灌水.注册机.顶贴机等等一些列非法的手段.通常站长都会通过一些后台的设置和插件等等一 切有效的方法预防,但更多的站长会通过限制用户注册会员,需注册 ...

  7. DEDECMS会员注册如何配置邮箱发送邮件功能

    网站邮件功能是一个非常基础和有效的通信工具,配合dede会员注册邮件验证功能可以大量的拒绝垃圾注册用户.那么如何配置DEDECMS会员注册邮箱发送邮件功能?   1:配置dedecms网站发信EMAI ...

  8. 【MVC】会员注册/登录,普通验证,会员名是否注册Ajax验证以及会员邮件验证实现原理

    using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentM ...

  9. web会员注册页面代码(4)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. C语言变长数组data[0]【总结】

    1.前言 今天在看代码中遇到一个结构中包含char data[0],第一次见到时感觉很奇怪,数组的长度怎么可以为零呢?于是上网搜索一下这样的用法的目的,发现在linux内核中,结构体中经常用到data ...

  2. 转: gcc 指定运行时动态库路径

    gcc 指定运行时动态库路径 Leave a reply 由于种种原因,Linux 下写 c 代码时要用到一些外部库(不属于标准C的库),可是由于没有权限,无法将这写库安装到系统目录,只好安装用户目录 ...

  3. [Git] Squash all of my commits into a single one and merge into master

    Often you have your feature branch you’ve been working on and once it’s ready, you just want it to m ...

  4. SSH连接linux时,长时间不操作就断开的解决方案

    转自:http://www.cnblogs.com/jifeng/archive/2011/06/25/2090118.html 修改/etc/ssh/sshd_config文件,找到 ClientA ...

  5. angularjs中的验证input输入框只能输入数字和小数点

    把js的验证方法改成angular可使用的方法 AngularJS文件的写法: $scope.clearNoNum = function(obj,attr){ //先把非数字的都替换掉,除了数字和.o ...

  6. android中使用通知功能

    本文实现一个功能:点击一个按钮,发送一个系统通知功能 添加一个Activity activity_main.xml: <?xml version="1.0" encoding ...

  7. Spring Validation 表单校验

    最近开发一个项目,发现字段校验比较多,同事提出使用Validation校验能更方便一些,今天记录下来,供以后参考: 一.在pom.xml中添加依赖: <dependency> <gr ...

  8. REP report开发技巧

    其他文章 报表开发介绍 posted @ 2017-02-23 18:525 by Mark

  9. python获取自己的环境变量

    1. import sys sys.path 2. from distutils.sysconfig import get_python_lib get_python_lib() 3. import ...

  10. Python两个变量的值进行交换的方法

    Python两个变量的值进行交换的方法 使用第三方变量: '''这是第一种赋值方法,采用第三方变量''' c = a a = b b = c 使用两个变量: '''使用两个变量''' a = a+b ...