0

I was led to believe that if the following code was added into 'Magento_Customer/layout/customer_account.xml', this would remove them options but they still remain visible even after doing the relevent commands afterwards. I have also tried to inseet them into 'Magento_Customer/view/frontend/layout/customer_account.xml' to no avail either. Any suggestions would be greatly appreciated. I am trying to remove these options
Image of what I am trying to remove

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


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


</body>
2
  • have you cleaned your cache? Jan 10, 2022 at 13:22
  • Code is fine, you have actually placed it in /path/to/webroot/app/design/Vendor/themename/Magento_Customer/layout/customer_account.xml? Jan 11, 2022 at 1:18

1 Answer 1

0

Put the code :

<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-newsletter-subscriptions-link" remove="true"/>
    <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
</body>

Then run the following command from the CLI :

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/

Your Answer

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

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