1

I have created custom module in Magento2. I have created succesfuly added custom link in customer dashboard. But I want to change existing label of customer dashboard account. I have attached screenshot.

enter image description here

Please Give me any suggestions.

1

There are two ways to achieve this

  1. You can change the label using xml

Just go to below location

magento_root\app\design\frontend\ {Package}\ {theme}\Magento_Customer\layout

create an .xml file there with name customer_account.xml

Put the below code there

<?xml version="1.0"?>
<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>
            <referenceBlock name="customer-account-navigation-orders-link">
                <arguments>
                    <argument name="label" xsi:type="string">Orders</argument>
                </arguments>
            </referenceBlock>
     </body>
</page>

To get the actual file with this settings you can have as a reference file available at the below location

magento_root\vendor\magento\module-customer\view\frontend\layout\customer_account.xml

  1. The other way is via en_US.csv file.

For this just create an en_US. csv file at the below location

magento_root\app\code\Package\Module\i18n

Put there below code in en_US.csv file

"My Orders","Orders"

Revert back if facing any problem.

  • If my answer helped you just vote it so that it can help others as well facing the same issue – ABHISHEK TRIPATHI Dec 16 '17 at 7:41
2

You can change your label if you create translation file in CSV format. In your module create a directory "i18n" and and your transalation.

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.