Magento 2 Customer Account Customisation

Magento 2 Customer Account Customisation

December 19, 2025 · By Magento Company
Magento 2 Customer Account Customisation

The customer account is your store’s self-service hub: orders, addresses, returns, preferences. Customising it - capturing the right data at registration, adding genuinely useful sections - improves both customer experience and the data you operate with. Here is how to extend it the upgrade-safe way.

Customer Attributes: Capture What Matters

Custom registration fields (trade reference, how-did-you-hear, date of birth for age-restricted goods) are customer EAV attributes, created in a data patch:

$eavSetup->addAttribute(
    \Magento\Customer\Model\Customer::ENTITY,
    'trade_reference',
    [
        'type' => 'varchar',
        'label' => 'Trade Reference',
        'input' => 'text',
        'required' => false,
        'visible' => true,
        'user_defined' => true,
        'system' => false,
    ]
);

The attribute then needs registration in the forms: customer attributes are surfaced via used_in_forms settings (adminhtml_customer, customer_account_create, customer_account_edit). Every attribute you add is also a data-protection decision - collect what you will use, not what you might.

Account Navigation Sections

Adding a section (“My Trade Documents”, “Subscriptions”) is a layout XML addition plus a controller:

<referenceBlock name="customer_account_navigation">
    <block class="Magento\Customer\Block\Account\SortLinkInterface"
           name="customer-account-navigation-trade-docs">
        <arguments>
            <argument name="path" xsi:type="string">tradedocs/index/index</argument>
            <argument name="label" xsi:type="string">Trade Documents</argument>
            <argument name="sortOrder" xsi:type="number">250</argument>
        </arguments>
    </block>
</referenceBlock>

The controller behind it must enforce the login boundary - account-area controllers extend the customer-authenticated action pattern; a custom section missing authentication checks is a data leak with a URL.

Dashboard Content

The account dashboard assembles blocks; adding or replacing them follows the standard layout-XML pattern. Useful additions: reorder shortcuts, loyalty balance (see the rewards post), open quotes for B2B. Keep dashboard queries cheap - the account dashboard is a frequent page and its blocks run outside full page cache.

The Guardrails

  • Never store sensitive data in customer attributes without thinking: attributes flow to exports, APIs and potentially integrations by default
  • Deletion readiness: GDPR erasure anonymises customers - custom attributes should be covered by the same handling
  • Form changes are checkout-adjacent: registration friction affects conversion; every field you add should earn its abandonment cost

Customise the account around what customers actually self-serve: order status, documents, reorders, preferences. A focused account section that gets used beats a comprehensive one that gets ignored - and every field you skip is data you never have to protect.

Development B2C Magento 2