0

anyone know how we can call custom phtml in order detail page admin side.

enter image description here

1 Answer 1

2

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

7
  • 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.
    – Pribhav
    Sep 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
    – Pribhav
    Sep 26, 2018 at 12:12
  • Ok i will review and update according. Sep 26, 2018 at 12:25

Your Answer

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

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