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

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.

| improve this answer | |
  • where to put that xml?file name or file layout name? – Asad Ullah Aug 12 at 8:43
  • put xml file this path : -app/code/Namespace/Modulename/view/adminhtml/layout/sales_order_view.xml – Mohit Patel Aug 13 at 5:36

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.