1

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.

asked Jul 1, 2021 at 7:03

1 Answer 1

1

Just change your layout file name :-

From :-

salase_invoice_custom.xml

To :-

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.