Magento: How to display customer's phone number on customer information field

Magento: How to display customer's phone number on customer information field

July 22, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: How to display customer's phone number on customer information field

Displaying Customer Phone Number on Magento Customer Information Page

In Magento, customer phone numbers are stored within the customer_address_entity table, while basic customer information like ID is stored in customer_entity. When you’re trying to show the customer’s phone number under their account information field, you need to access this data correctly. Let me guide you through the process.

Understanding the Data Structure

Magneto stores customer addresses as separate entities linked to a customer via an address book. To get the correct phone number, we must first fetch the customer’s primary address and then retrieve the telephone from it.

Fetching the Customer’s Primary Address

In your customer\account\dashboard\info.phtml file, you can access the current customer object using $this->getCustomer(). However, this only gives you basic customer information. To get the primary address details, update your code like this:

<?php $primaryAddressId = $this->getCustomer()->getPrimaryBillingAddress();
$primaryAddress = Mage::getModel('customer/address')->load($primaryAddressId);

We first fetch the ID of the primary billing address using $this->getCustomer()->getPrimaryBillingAddress(). Then, we load this address into a new Mage_Customer_Model_Address object.

Retrieving the Phone Number

Now that we have the customer’s primary address loaded in $primaryAddress, we can easily retrieve the phone number:

<?php $telephone = $primaryAddress->getTelephone();

Displaying the Phone Number on the Page

Finally, you can display the phone number right below other customer information fields. Update this section of your info.phtml file:

<!-- Other fields like name, email go here -->

<?php echo $this->__('Phone:') ?>
<?php if ($telephone): ?>
    <span class="std"><?php echo $this->escapeHtml($telephone); ?></span>
<?php else: ?>
    <span class="empty-placeholder"><?php echo $this->__('Not specified'); ?></span>
<?php endif; ?>

Conclusion

To display the customer’s phone number on their account information page, you need to fetch the primary address first and then retrieve the telephone from it. The key is understanding how Magento structures customer data across multiple tables.

Remember, always be careful when manipulating core files like info.phtml. Consider using a custom theme or module for such modifications to preserve your changes during updates.

For more advanced customizations in Magento, I recommend checking out Laravel Company’s guide on Magento extension development. It provides step-by-step tutorials and best practices.

Database Themes Customers

Our network