2

How to override vendor/magento/module-shipping/view/adminhtml/templates/view/form.phtml file in magento2

5

Create adminhtml_order_shipment_view.xml file in app\code\CompanyName\ExtensionName\view\adminhtml\layout\

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance dc" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="sales_shipment_view">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">CompanyName_ExtensionName::form.phtml</argument>
        </action>
    </referenceBlock>
</page>

Put form.phtml file app\code\CompanyName\ExtensionName\view\adminhtml\templates\ folder.

Let me know if you have any query.

0

If you want to override this template file- then use bellow XML:-

vendor/magento/module-shipping/view/adminhtml/templates/view/form.phtml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<block class="Magento\Shipping\Block\Adminhtml\View" name="sales_shipment_view">
    <referenceBlock name="form">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">CompanyName_moduleName::form.phtml</argument>
        </action>
    </referenceBlock>
</block>
</page>

I have resolve my blank page issue and it's Working Fine.

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.