0

I try to override

D:\XAMPP\htdocs\vinm2\vendor\magento\module-shipping\view\adminhtml\templates\view\form.phtml

So I copy it to

D:\XAMPP\htdocs\vinm2\app\design\frontend\Vend\vision\Magento_Shipping\templates\view\form.phtml

I also tried

D:\XAMPP\htdocs\vinm2\app\design\frontend\Vend\vision\Magento_Shipping\view\adminhtml\templates\view\form.phtml

but not working.

can any one let me know what is wrong here?

Updated:

As per suggestion here i create module..

D:\XAMPP\htdocs\vinm2\app\code\Bkjain\Shipp have below files & directory

1: etc 2: view 3: registration.php

etc have module.xml with below code.

<?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="Bkjain_Shipp" setup_version="1.0.0">
    </module>
</config>

2: view have adminhtml--

                    -layout -> adminhtml_order_shipment_view.xml

                    -templates -> form.phtml

adminhtml_order_shipment_view.xml have below code.

<?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">Bkjain_Shipp::form.phtml</argument>
        </action>
    </referenceBlock>

form.phtml have default code but it not display anything.. IF i delete content of that file & just write echo then it show echo value ..

enter image description here

5
  • I want to know how to override any file from vendor directory to theme directory.. Jul 4 '17 at 10:00
  • You cant override adminhtml template file into your theme, you have to create module for that. Jul 4 '17 at 10:08
  • follow this link magento.stackexchange.com/questions/161004/… Jul 4 '17 at 10:16
  • Thank you @Rajkumar.E .. I will check and post here if i have any issue.. Jul 4 '17 at 10:21
  • Hi file is override but the content of form.phtml not show .. If i delete the content of file and just simple echo anything then it will show .. but default content not load of that file.. Jul 4 '17 at 13:44
0

check the below code.

app/design/frontend/<Vendor_Theme>/<name_theme>/Magento_<module_name>/templates

Example

vendor file path:

app/code/Magento/Catalog/view/frontend/templates/product/list.phtml

Your file path:

app/design/frontend/<Vendor_Theme>/<name_theme>/Magento_Catalog/templates/product/list.phtml

it is only for frontend template files.

Clear cache

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.