0

I am trying to remove some tabs https://prnt.sc/I0JvtmM41ROP

I am using below file path and code

app/design/frontend/vendorname/themename/Magento_Theme/layout/default.xml

    <!-- 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"/>

But not working.

3 Answers 3

0

override customer layout file in your theme

app/design/frontend/[Namespace]/[Theme]/Magento_Customer/layout/customer_account.xml

Make use of a tag to remove any extra link from my account.

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <body>

        <!-- 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"/>

        <!-- 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"/>

    </body>

</page>

Now, clear cache and verify the My Account page the links will be removed.

0

You can do it simply using Module

Create file customer_account.xml inside your custom module as below path

app/code/Vendor/Module/view/frontend/layout/customer_account.xml

And add below code add or remove reference block name according to your need

<?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>
        <!-- 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"/>

        <!-- Store Payment link -->
        <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>

        <!-- Product review link -->
        <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>

        <!-- Downloadable Product link -->
        <referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/>
    </body>
</page>

At last clear the cache and refresh the page

Hope works for you!

0

Simply you can override it within theme

app/design/frontend/Vendor/Theme/Magento_Customer/layout/customer_account.xml

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>    
        <referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
    </body>
</page>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.