为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/ ...
随机推荐
- WPF装饰元素
Border: <Style TargetType="Border"> <Setter Property="CornerRadius" Val ...
- (转)【Unity Shaders】Alpha Test和Alpha Blending
转自:http://blog.csdn.net/candycat1992/article/details/41599167 写在前面 关于alpha的问题一直是个比较容易摸不清头脑的事情,尤其是涉及到 ...
- OpenGL book list
From: https://www.codeproject.com/Articles/771225/Learning-Modern-OpenGL A little guide about mo ...
- BigDecimal 的幂次方运算
public static void main(String[] args){ BigDecimal bg1, bg2; bg1 = new BigDecimal("200000.45&qu ...
- (转)C/C++ 程序设计员应聘常见 面试笔试 试题深入剖析
C/C++ 程序设计员应聘常见 面试笔试 试题深入剖析 http://www.nowcoder.com/discuss/1826?type=2&order=0&pos=23&p ...
- GOOD BLOG URL
1TEST http://www.cnblogs.com/Javame/p/3653509.html 综合 http://shiyanjun.cn/
- ArcGIS查找空洞多边形
现需要用ArcGIS将多边形面层中是"空洞"的要素查找出来. 代码思路 一开始没有思路,于是写了代码,基本流程如下: 1)遍历需要判断的要素(可通过属性筛选): 2)检查某一要素相 ...
- tomcat管理员在远程(不同)机器上访问管理页面
tomcat8.5管理员默认只能在安装tomcat的机器上访问,如果想在其他机器上访问,则需要进行配置修改 添加用户和权限(<tomcat>\conf\tomcat-users.xml): ...
- js 判断l对象类型
var obj = {}; obj.isObject = function (obj) { return Object.prototype.toString.call(obj) == '[object ...
- LintCode: Single Number II
一篇解析比较详细的文章:http://www.acmerblog.com/leetcode-single-number-ii-5394.html C++ 解法(1) 求出每个比特位的数目,然后%3,如 ...