Categories: How ToMagento 2

How to Add Custom Tab in Customer Account Section in Magento 2

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

  1. Create customer_account.xml into Magecomp/Mycard/view/frontend/layout
       
          
             
                
                   mycard/customer/index
                    My Cards
                
             
          
       
                               
    
  2. Create mycard_customer_index.xml into Magecomp/Mycard/view/frontend/layout
     
     
     
         
                 
                    My Card 
                 
          
          
             
             
         
     
    
    
  3. Create Index.php into Magecomp/Mycard/Controller/Customer
    
    
Click to rate this post!
[Total: 7 Average: 4.7]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

View Comments

  • Hi How can I open this default like when i click account button then first it show me the default this page.

  • 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.

Recent Posts

Magento 2: Add Quantity Increment and Decrement on Category Page

Hello Magento Friends, In this blog, we will discuss about adding quantity increment and decrement…

19 hours ago

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

4 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

6 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

6 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

7 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

1 week ago