0

I am unable to override this file in adminhtml of magento_sale module here is the path

vendor\magento\module-sales\view\adminhtml\templates\order\create\totals\shipping.phtml 

The issue is that file is not rendering from layout and also can't find its block so how can i override this file any solutions

1 Answer 1

0

Method 1

You can create your custom module and place this file in

app/code/Namespace/Modulename/view/adminhtml/layout/sales_order_view.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="shipping_info"> <action method="setTemplate"> <argument name="template" xsi:type="string">Vendor_Module::order/create/totals/shipping.phtml</argument> </action> </referenceBlock> </body> </page> 

and then create the template phtml file and place your code there.

app/code/Namespace/Modulename/view/adminhtml/templates/order/create/totals/shipping.phtml

Method 2

Another easy method is by placing the file in

app/design/adminhtml/Vendor/ThemeName/Magento_Sale/templates/order/create/totals/shipping.phtml 

Please NOTE this :- You change any methods but run below commands

remove var/cache folder remove var/view_preprocessed folder php bin/magento setup:di:compile php bin/magento setup:upgrade php bin/magento setup:static-content:deploy php bin/magento c:c php bin/magenot c:f 

THANKS.

2
  • where to put that xml?file name or file layout name? Commented Aug 12, 2020 at 8:43
  • put xml file this path : -app/code/Namespace/Modulename/view/adminhtml/layout/sales_order_view.xml Commented Aug 13, 2020 at 5:36

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.