Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Adding Custom Fields for Billing Address in the registration form
 
dondo
Jr. Member
 
Total Posts:  4
Joined:  2009-01-12
 

I added Email Address for my Billing Address. It seems its not working.

File: /app/design/frontend/default\default/templat/customer/formregister.phtml

<li>
                <
div class="input-box">
                    <
label for="billing_email_address"><?php echo $this->__('Email Address'?> <span class="required">*</span></label><br/>
                    <
input type="text" name="billing_email_address" id="billing_email_address" value="<?php echo  this->htmlEscape($this->getFormData()->getBilling_email_address()) ?>" title="<?php echo $this->__('Email Address') ?>" class="validate-email required-entry input-text" />
                </
div>
</
li>

File: /app/code/core/Mage/Customer/etc/config.xml

<customer_dataflow>
                <
store_id><system>1</system></store_id>
                <
store><ignore>1</ignore></store>
                <
entity_id><system>1</system><ignore>1</ignore></entity_id>
                <
attribute_set_id><system>1</system><ignore>1</ignore></attribute_set_id>
                <
attribute_set><ignore>1</ignore></attribute_set>
                <
entity_type_id><system>1</system></entity_type_id>
                <
increment_id><system>1</system><ignore>1</ignore></increment_id>
                <
parent_id><system>1</system></parent_id>
                <
created_at><system>1</system></created_at>
                <
updated_at><system>1</system></updated_at>
                <
group_id><ignore>1</ignore></group_id>
                <
type_id><system>1</system><ignore>1</ignore></type_id>
                <
type><ignore>1</ignore></type>
                <
created_in><system>1</system><ignore>1</ignore></created_in>
                <
website_id><system>1</system></website_id>
                <
default_billing><system>1</system></default_billing>
                <
default_shipping><system>1</system></default_shipping>

                <
prefix><billing>1</billing><shipping>1</shipping><mapped>1</mapped></prefix>
                <
firstname><billing>1</billing><shipping>1</shipping><required>1</required><mapped>1</mapped></firstname>
                <
middlename><billing>1</billing><shipping>1</shipping><mapped>1</mapped></middlename>
                <
lastname><billing>1</billing><shipping>1</shipping><required>1</required><mapped>1</mapped></lastname>
                <
suffix><billing>1</billing><shipping>1</shipping><mapped>1</mapped></suffix>
                <
street_full><billing>1</billing><shipping>1</shipping></street_full>
                <
street1><street>1</street></street1>
                <
street2><street>1</street></street2>
                <
street3><street>1</street></street3>
                <
street4><street>1</street></street4>
                <
street5><street>1</street></street5>
                <
street6><street>1</street></street6>
                <
street7><street>1</street></street7>
                <
street8><street>1</street></street8>
                <
city><billing>1</billing><shipping>1</shipping></city>
                <
region><billing>1</billing><shipping>1</shipping></region>
                <
country><billing>1</billing><shipping>1</shipping><billing_required>1</billing_required><shipping_required>1</shipping_required></country>
                <
postcode><billing>1</billing><shipping>1</shipping><billing_required>1</billing_required><shipping_required>1</shipping_required></postcode>
                <
telephone><billing>1</billing><shipping>1</shipping></telephone>
                <
company><billing>1</billing><shipping>1</shipping></company>
                <
fax><billing>1</billing><shipping>1</shipping></fax>
                <
billing_email_address><billing>1</billing><shipping>1</shipping></billing_email_address>
            </
customer_dataflow>

I added <billing_email_address>

File: /app/code/core/Mage/Customer/Model/Entity/Setup.php
I added billing_email_address at the customer_address array

'billing_email_address' => array(
                        
'label'         => 'Email Address',
                        
'sort_order'    => 99,
                    )

And finally I added a the field in the Database.

$AttrCode 'billing_email_address';
$settings = array (
  
'position' => 0,
  
'is_required'=> 1,
  
'label' => "Email Address",
  
'backend_type'  => "static",
  
'frontend_input' => "text",
  
'frontend_class' => "validate-email"
);
$setup->addAttribute('1'$AttrCode$settings);

And it seems the data has not been saved..
Can anybody help me please? I appreciate it. I’m been working now for almost 3hours about this… and very confuse. (#_#)

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dondo
Jr. Member
 
Total Posts:  4
Joined:  2009-01-12
 

Hello! Do anybody knows about this?

Help!!!! Help!!!! question

 
Magento Community Magento Community
Magento Community
Magento Community
 
subesh
Sr. Member
 
Avatar
Total Posts:  145
Joined:  2009-01-08
 

I could not get it.. coz I have added custom field but i am not sure what you need…

 
Magento Community Magento Community
Magento Community
Magento Community
 
vmaillot
Jr. Member
 
Total Posts:  19
Joined:  2009-01-05
Montreal
 

@Dondo
Don’t know if you get it concerning the “required” aspect, but if not =>
Take a look at app/code/core/Mage/Customer/Model/Address/Abstract.php
You could override the function validate() in order to set the field “billing_email_address” as mandatory.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vij
Sr. Member
 
Total Posts:  81
Joined:  2009-02-13
 

whn i edit the billing address the shipping address also update with billing address.....
i dont know y its happing.....
pls help me out with this…
thanks in advance

 
Magento Community Magento Community
Magento Community
Magento Community
 
mochalovv
Jr. Member
 
Total Posts:  1
Joined:  2009-08-02
 

dondo, did u solve the problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

Hope the Customer Attributes extension will solve the problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bolasevich
Sr. Member
 
Avatar
Total Posts:  235
Joined:  2008-03-04
Newington, CT USA
 

this does everything mentoned above as well as additional features over amasty and supports additional field types

http://www.magentocommerce.com/extension/packages/module/3820/custom_customer_registration_and_checkout_fields

 
Magento Community Magento Community
Magento Community
Magento Community
 
nabler
Sr. Member
 
Total Posts:  80
Joined:  2010-07-27
 
Amasty - 02 March 2010 02:14 PM

Hope the Customer Attributes extension will solve the problem.

i wish.... LOL
i wanna add the check box news lletter subscribe there.......

 
Magento Community Magento Community
Magento Community
Magento Community
 
chapagain
Sr. Member
 
Avatar
Total Posts:  202
Joined:  2009-07-19
 

Can anyone answer / give solution rather than giving link to paid modules??

I don’t want to buy modules. And, I don’t think there is any free module for this. So, can anyone kindly post the solution ? smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
chapagain
Sr. Member
 
Avatar
Total Posts:  202
Joined:  2009-07-19
 

One solution will be overriding formPostAction() function of Mage_Customer_AddressController class.

Write the following code like below:-

housenumber is the new attribute that I have added to customer entity.

// this line is already present in the function
$addressErrors  $addressForm->validateData($addressData);

// this is the new line to be added
$address->setHousenumber($this->getRequest()->getPost('housenumber'));

However, my question is .. can’t it be done without overriding controller class? I mean, can’t we do it just by adding attribute and adjusting some settings in config xml file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sduarte
Jr. Member
 
Total Posts:  29
Joined:  2011-01-05
 

I know this is an old thread, and I want to do the same in Magento 1.5 ... I get the field to show (I’m trying to put a field called RFC) the textbox shows, but it doesn’t save any data / or retreives it.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top