Add Mobile Attribute to Customer Account

The following instructions will add a new customer attribute called Mobile.  This attribute will be added to the Customer information only, it will not be added to the Customer Address.

Apologies for the pastebin links, my syntax highlighter is currently out of action.

Create the following files:

app/code/local/PaulDonnelly/Mobile/etc/config.xml
app/code/local/PaulDonnelly/Mobile/Helper/Data.php
app/code/local/PaulDonnelly/Mobile/sql/mobile_setup/mysql4-install-0.1.0.php
app/etc/modules/PaulDonnelly_Mobile.xml

Add the following content to files:

app/code/local/PaulDonnelly/Mobile/etc/config.xml

See for content: http://pastebin.com/8xeFPJFh

app/code/local/PaulDonnelly/Mobile/Helper/Data.php

See for content: http://pastebin.com/dTvc1qMW

app/code/local/PaulDonnelly/Mobile/sql/mobile_setup/mysql4-install-0.1.0.php

See for content:  http://pastebin.com/VXq0LY7M

app/etc/modules/PaulDonnelly_Mobile.xml

See for content:  http://pastebin.com/9DFdRnuL

Once you have uploaded these files and clear your cache you will notice a new Mobile input field available in the customer admin section (Customers/Manage Customers/Click Customer/Click Account Information).

Screen Shot 2015-01-21 at 16.00.50

Mobile Number is now added to the customer account.

 Adding Mobile to Customer Account Edit Form.

Create/Edit: app/design/frontend/yourpackage/yourtheme/template/customer/form/edit.phtml

See for Content: http://pastebin.com/90huyGAV

Insert  the above code around line 46 before  <?php $_dob = $this->getLayout()->createBlock(‘customer/widget_dob’) ?>

Screen Shot 2015-01-21 at 16.20.23

 Adding Mobile to Customer Registration form.

Create/Edit: app/design/frontend/yourpackage/yourtheme/template/persistent/customer/form/register.phtml

See for Content: http://pastebin.com/mzdFQCbp

Insert  the above code around line 57 before  <?php $_dob = $this->getLayout()->createBlock(‘customer/widget_dob’) ?>

Screen Shot 2015-01-21 at 16.28.18

You and your customers should now be able to add/edit their mobile number.

Please note this has only been tested on Magento 1.9.1.0.

ShareShare on Facebook0Tweet about this on TwitterShare on Google+0Share on LinkedIn0Share on Reddit0Share on StumbleUpon0

Published by

Paul Donnelly

Hi I'm Paul, an avid Magento Developer from Northern Ireland. With almost 8 years of Magento experience under my belt, I still have a strong passion for it. By day I work as a Senior Ecommerce Developer for one of the top web development agencies in Northern Ireland, Pale Blue Dot. If you'd like to keep up to date with my latest posts and rants, you can follow me on Twitter: @PaulDonnelly

Leave a Reply

Your email address will not be published. Required fields are marked *

eleven + 11 =