anyone know how we can call custom phtml in order detail page admin side.
1 Answer
I think you should override template Magento_Sales::order/view/history.phtml file by using below code.
view/adminhtml/layout/sales_order_view.xml
<referenceBlock name="order_history">
<action method="setTemplate">
<argument name="template" xsi:type="string">Vendor_Module::order/view/history.phtml</argument>
</action>
</referenceBlock>
Then, copy main Magento_Sales::order/view/history.phtml to your Vendor_Module and modify it as per your requirement
-
This way I am already working on but without that did you have any idea???? Sep 26, 2018 at 10:56
-
I do not think so if any other Magento way to do the same but if you really want to do that, you can add that block to anywhere in order total section then prepend or append it with comment box using jquery or js.– PribhavSep 26, 2018 at 11:39
-
In the same way, we are doing. Did u know after over right template how we can load custom phtml through knockout js?? Sep 26, 2018 at 11:51
-
If you add a block to anywhere you do not need to override history template. I was talking about to add a custom block in sales_order_view with a custom template and then using jQuery js you can move the element. But if you do it via knockout js I think this is the suitable tutorial webkul.com/blog/use-knockout-js-custom-template-magento2– PribhavSep 26, 2018 at 12:12
-