How to add a custom tab myAccount section in Magento 2

 In Magento blog

In Magento 2, when customer login to the website, he is given the My Account option on the right side. Clicking on it opens the Myaccount section. In this blog, we are going to explain how to add additional tabs to that section.

Why is it important to add custom tabs?  Because to get some additional information of customers. To show a demo of a new product. A custom tab is created for another such additional requirement.

It is very easy to make a custom tab see this step:-

⇒ You have to create the file customer_account.xml in this path Vendorname/Modulename/view/frontend/layout

⇒ You have to create  file  routename _customer_index.xml  in this path Vendorname/Modulename/view/frontend/layout 

⇒  You have to create  file  routes.xml in this path Vendorname/Modulename/etc/frontend

⇒  You have to create  file  Index.php  in this path Vendorname/Modulename/Controller/Customer

⇒ You have to create  file  customtab.phtml  in this path Vendorname/Modulename/ view/frontend/templates/customer/account

Then you should do this commend php -dmemory_limit=2G bin/magento cache:flush and see the custom tab has successfully landed in the myAccount section. i hope you have to understand this blog.if you have any questions let me know in comment section

Thank You  :〉

Leave a Comment


0