In Magento 2, whenever customers register and login to store, they are redirected to “My Account” section. This section has default tabs like Account information, orders, product reviews, wishlist etc. in which respective data is displayed and stored. Now sometimes you want to create a custom module and show some custom tab loaded with some important information. For example, you have created an extension for refund management and want customers to allow refund request from frontend. Here, you will need to create a separate custom tab with a form to allow refund requests. This can be done through adding custom tab in customer account section in Magento 2.
Follow the steps listed below to add custom tab on customer account section on frontend in Magento 2.
Add below files into your custom extension.
Ex: Namespace: Magecomp
Modulename: Mycard
- Create customer_account.xml into Magecomp/Mycard/view/frontend/layout
12mycard/customer/indexMy Cards - Create mycard_customer_index.xml into Magecomp/Mycard/view/frontend/layout
1My Card - Create Index.php into Magecomp/Mycard/Controller/Customer
12345678<!--?php// Add Some Code Hereecho “Hello Friends”;</pre></li></ol><p>Hope this blog has thoroughly helped you to add custom tab in customer account section. Still if you stuck with something or find any queries, feel free to ask me anytime, I would be happy to help you. I would be glad to get your feedback and suggestions in comment section.</p><p><a href="https://magecomp.com/hire-magento-developer.html?utm_source=blog&utm_medium=CTA&utm_campaign=mcstdev"><img src="https://magecomp.com/blog/wp-content/uploads/2016/08/CTA_magento-custom-development.jpg" alt="CTA_magento-custom-development" width="669" height="200" class="aligncenter size-full wp-image-927" ?-->
Hi How can I open this default like when i click account button then first it show me the default this page.
You can do it by setting “Active Tab”
Hi, i am following this tutorial for add new tab on dashboard , but unable to find out where i need to place this complete module ?
i have place Magecomp folder inside of app/code folder but nothing showing on frontend. Can you please let me know where i can place this module ?
Please confirm you have created another required file for the extension and you have enabled that from CLI.
Hi, i am following this tutorial for add new tab on dashboard , but unable to find out where i need to place this complete module ?
i have place Magecomp folder inside of app/code folder but nothing showing on frontend. Can you please let me know where i can place this module ?
Can we do this for specific customer group only ? We want to add custom tab for the specific customer group.
There is no direct way to put condition to create tab for particular customer group but you can surely contact us for help.
Can we do this for specific customer group only ? We want to add custom tab for the specific customer group.
There is no direct way to put condition to create tab for particular customer group but you can surely contact us for help.