cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove nav item in customer account ?

How to remove nav item in customer account ?

I need to add / remove nav item in customer dashboard.

I tried to hide the element from CSS file but, no luck.

9 REPLIES 9

Re: How to remove nav item in customer account ?

Tried to remove using of :nth-child.

 

.account-nav-content ul li:nth-child(12) {
  display:none !important;
}

In custom.css file. But still dosen't work.

Re: How to remove nav item in customer account ?

Hi @BYK 

 

Assuming you're trying to remove top-navbar of categories, then follow these steps to remove top-navbar from customer account page :

  1. Create customer_account_index.xml inside Vendor/Module/view/frontend/layout.
  2. Add this code to file :
    <?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">
        <body>
            <referenceBlock name="navigation.sections" display="false" />
        </body>
    </page>

 

Thank you !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: How to remove nav item in customer account ?

@BYK 

 

If you want to remove side nav-bar, Put this file customer_account.xml in: app/design/frontend/[Namespace]/[Theme]/Magento_Customer/layout folder :

Content of customer_account.xml :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <!-- Store credit -->
        <referenceBlock name="customer-account-navigation-customer-balance-link" remove="true"/>
        <!-- Downloadable product link -->
        <referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/>
        <!-- Subscription link -->
        <referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" remove="true"/>
        <!-- Billing agreement link -->
        <referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>
        <!-- Product review link -->
        <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
        <!-- My credit card link -->
        <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
        <!-- Account link -->
        <referenceBlock name="customer-account-navigation-account-link" remove="true"/>
        <!-- Account edit link -->
        <referenceBlock name="customer-account-navigation-account-edit-link" remove="true"/>
        <!-- Address link -->
        <referenceBlock name="customer-account-navigation-address-link" remove="true"/>
        <!-- Orders link -->
        <referenceBlock name="customer-account-navigation-orders-link" remove="true"/>
        <!-- Wish list link -->
        <referenceBlock name="customer-account-navigation-wish-list-link" remove="true"/>
        <!-- Gift card link -->
        <referenceBlock name="customer-account-navigation-gift-card-link" remove="true"/>
        <!-- Order by SKU -->
        <referenceBlock name="customer-account-navigation-checkout-sku-link" remove="true"/>
        <!-- Gift registry -->
        <referenceBlock name="customer-account-navigation-giftregistry-link" remove="true"/>
        <!-- Reward points -->
        <referenceBlock name="customer-account-navigation-reward-link" remove="true"/>
    </body>
</page>

Thank you !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: How to remove nav item in customer account ?

@gaurav_harsh1 

 

I tried like this in layout directory. But still no luck

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="header.content">
            <container name="website-header" label="Website" as="website-header" htmlTag="div" htmlClass="website-wrapper">
                <block class="Magento\Store\Block\Switcher" name="website.header" template="Magento_Theme::html/website-header.phtml"/>
                <block class="Magento\Framework\View\Element\Template" name="misc.html.from.admin" template="Magento_Theme::html/custom-misc.phtml" after="-" />
            </container>
        </referenceBlock>
        <referenceBlock name="xyz" display="false" />
    </body>
</page>

Re: How to remove nav item in customer account ?

@BYK 

 

If you want to remove top nav of categories, you can try my solution, it worked in my system.

 

Thanks

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: How to remove nav item in customer account ?

@gaurav_harsh1 

 

You are total out of my question, I need to remove / hide the left side nav item where I have highlighted with yellow color, in the below snapshot, the list item number is 12th one.

myaccount.png

Re: How to remove nav item in customer account ?

@gaurav_harsh1 

 

Hope you got my point.

 

I tried to make changes in customer account block

customer_account_navigation

 

 name="customer-account-navigation-account-link"

Still no luck!

Re: How to remove nav item in customer account ?

@gaurav_harsh1 

 

I have modified the code what you provided and now it works well.

 

Thank you for you help!

Re: How to remove nav item in customer account ?

@BYK 

 

Yes I understood what you wanted to remove, happy to help you Smiley Happy

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy