0

I want to customize the Invoice page, so I override .phtml file in:

vendor\magento\module-sales\view\adminhtml\templates\order\invoice\create\items.phtml

I tried to create many files but failed:

MyVendor\MyModule\view\adminhtml\layout\salase_invoice_custom.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>
        <referenceBlock name="order_items">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">MyVendor_MyModule::order/invoice/create/items.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

MyVendor\MyModule\etc\module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="MyVendor_MyModule" setup_version="1.0.0" schema_version="1.0.0">
        <sequence>
            <module name="Magento_Sales"/>
        </sequence>
    </module>
</config>

MyVendor\MyModule\view\adminhtml\templates\order\invoice\create\items.phtml

<h1>Hello</h1>

So please let me know what I need to add/modify so that I can resolve this problem.

Thanks in advance.

0

Just change your layout file name :-

From :-

salase_invoice_custom.xml

To :-

sales_order_invoice_new.xml
1
  • Thank you very much, it worked! Jul 1 at 7:34

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.