第一步、新建一个模块,在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. 'Lock wait timeout exceeded; try restarting transaction'问题

    OperationalError: (1205, 'Lock wait timeout exceeded; try restarting transaction') 原因很简单,太多错误,意外处理没有 ...

  2. Cocos2d-X研究之v3.x 事件分发机制具体解释

    事件分发机制 " src="http://www.cgzhw.com/wp-content/uploads/2014/07/inherent3.png" style=&q ...

  3. Android 开源项目 eoe 社区 Android 客户端

    本文内容 环境 开源项目 eoe 社区 Android 客户端 本文介绍 eoe 社区 Android 客户端.它是一个开源项目,功能相对简单,采用侧边菜单栏.可以学习一下.点击此处查看 GitHub ...

  4. CAD VC++安装失败 1603错误

    问题描述 想安装一个高版本的CAD来着,可安装报错始终报错1603.具体表现为 DESKTOP-F7K8C37    Installing Microsoft Visual C++ 2008 SP1 ...

  5. ArcGIS 后台服务器抛出异常

    ArcGIS工具箱是一个非常经典的工具应用,它就像一个做过很多项目.技术不断丰富的大神.以至于,现在ESIR与ITT公司合作,搞得新版的ENVI都有工具箱这样的界面了. 抛出异常 并不是每一个问题都能 ...

  6. vsphere 5.1 改进和SSO理解

    虚拟交换器 以5.1版的vSphere而言,VMware在VDS上提供一些新功能.例如,现在可以用快照的方式,来备份还原VDS组态及网络端口群组(port group)的组态,以因应vCenter S ...

  7. Hotmail Smtp邮箱发送的端口

    1.最近有项目需求做监控报警. 2.使用Smtp发邮件时,网上找了一大堆,Smtp服务是:smtp.live.com   端口是:25或587,试了好多次都不行.原来端口是465. 3.发送时,我启用 ...

  8. h5画图表

    折线: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8&q ...

  9. 创新大师Steve Blank: 你真的知道什么是真正的精益创业吗?

    编者注:本文来自被誉为当代创新大师的Steve Blank的博客. 中文版由天地会珠海分舵编译. 全文从当今非常多人对精益创业的误解作为一个切入点,深入的分析了为什么人们这么easy就对精益创业产生误 ...

  10. 玩转Bootstrap

    一:bootstrap基本模版 <!DOCTYPE html> <html lang="en"> <head> <meta charset ...