I have created customer custom attributes using install data, and I want to display this attributes in the Magento admin customer view/personnel information section, next to customer group, Need to achieve this

In this picture I have edited my core files and shows the customer group again , similarly I need to show the custom customer attributes, Is there any method of doing it with out editing core files.

My install data file shows below and i also required this fields in the API

                'type'                  => 'varchar',
                'label'                 => 'Customer Amount',
                'input'                 => 'text',
                'required'              => false,
                'visible'               => true,
                'user_defined'          => true,
                'position'              => 999,
                'system'                => 0,
                'visible_on_front'      => true,
                'is_used_in_grid'       => true,
                'is_visible_in_grid'    => true,
                'is_filterable_in_grid' => true,


        $customerCLV = $this->eavConfig->getAttribute(Customer::ENTITY, 'customer_amnt');

1 Answer 1


Note: I have checked the code in Magento version 2.2.4.

The Personal Information section under the Customer View tab comes from the /vendor/magento/module-customer/view/adminhtml/templates/tab/view/personal_info.phtml file, which gets the required information from it's block file /vendor/magento/module-customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php.

If you want to show some information in this section, you need to override the block file first and write the custom function to return the required data.

Below is an example:

I wanted to show gender information. So content added to my phtml file:

    <th><?= $block->escapeHtml(__('Account Lock Expp:')) ?></th>
    <td><?= $block->escapeHtml($block->getGenderInfo()) ?></td>

and the content of my custom function:

public function getGenderInfo() {
    return $this->getCustomer()->getGender();

I hope it is clear now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.