0

i want to remove Address Book Block from customer dashboard

i did tried below code but it seems not working

enter image description here

2 Answers 2

1

You can achieve by removing the block from customer_account_index.xml

Create customer_account_index.xml layout file in your custom module or theme directory and add below code:

<referenceBlock name="customer_account_dashboard_address" remove="true" />
0

Create a customer_account_index.xml inside Vendor/Module/view/frontend/layout/customer_account_index.xml

<?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">
    <update handle="customer_account"/>
    <body>
        <referenceContainer name="content">
            <referenceBlock name="customer_account_dashboard_address" remove="true" />
        </referenceContainer>

    </body>
</page>

And if you want to remove Unwanted Navigation tab links from Customer account dashboard Create a file customer_account.xml inside Vendor/Module/view/frontend/layout/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">
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
        
            <!-- Remove unwanted account navigation links -->

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

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.