1

I would like to remove the Invoices link from the customer account page in Magento 2:

enter image description here

I tried to search it in templates and layout files but no luck.

Someone know how to do?

2

Found it.

Create this file within your theme dir:

<theme_dir>/Magento_Sales/layout/sales_order_info_links.xml

Then you can remove links with this:

<?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>
    <referenceContainer name="content">

      <!-- <referenceBlock name="sales.order.info.links" remove="true" /> -->
      <!-- <referenceBlock name="sales.order.info.links.information" remove="true" /> -->
      <referenceBlock name="sales.order.info.links.invoice" remove="true" />
      <!-- <referenceBlock name="sales.order.info.links.creditmemo" remove="true" /> -->

    </referenceContainer>
  </body>
</page>
  • Might also be good to add this to sales_order_guest_info_links.xml – thaddeusmt Jan 24 '18 at 3:40
1

Write below code in given file path

app/design/frontend/Vendor/theme/Magento_Theme/layout/default.xml

<referenceBlock name="sales.order.info.links.invoice" remove="true" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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