1

I need to change the Address book text to My Contact Details in customer dashboard sidebar links.

enter image description here

I used this below code but no use.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom">
    <body>       
        <referenceContainer name="sidebar.main">
            <block class="Magento\Framework\View\Element\Template" name="sidebar.main.account_nav" template="Magento_Theme::html/collapsible.phtml" before="-">

                    <block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-address-link">
                        <arguments>
                            <argument name="label" xsi:type="string" translate="true">My Contact Details</argument>
                            <argument name="path" xsi:type="string">customer/address</argument>
                            <argument name="sortOrder" xsi:type="number">190</argument>
                        </arguments>
                    </block>
            </block>
        </referenceContainer>                
    </body>
</page>

In **customer_account.xml*.*

4

Instead to modify your template for this label change just modify label by translations. create folder i18n in your custom theme in it create file en_US.csv and add translation into this file like following :

"Address book", "My Contact Details"

structure will be following:

enter image description here

Once you create this you can change every label in this way for whole site

2

Just Copy This File In Your Theme vendor/magento/module-customer/view/frontend/templates/account/dashboard/address.phtml

in This Path Paste address.phtml File app/design/frontend/Theme/ThemeName/Magento_Customer/templates/account/dashboard

In Line no. 13 Change Text As Per Your Requirement.

After This Clean Cache and Test.


Also Using Csv File Make Change This Title

Create {Your_LanagaugeCode}.csv at if not exits

File Path :- magento2/app/design/frontend/{themevendorname}/{Themename}/i18n/)

Then add below code at this csv file

"Address book", "My Contact Details"

Then do Cache flush and do the static content deploy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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