0

I have overridden the admin .phtml files

vendor/magento/module-sales/view/adminhtml/templates/order/view/items/renderer/default.phtml

but nothing shows.

This is my module.xml

app/code/TemplateMonster/Orderitem/etc/module.xml

<?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="TemplateMonster_Orderitem" setup_version="1.0.0" active="true">       
    <sequence>
            <module name="Magento_Sales"/>
        </sequence>
        </module>
</config>

This is my sales_order_view.xml file

app/code/TemplateMonster/Orderitem/view/adminhtml/layout/sales_order_view.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">    
    <body>
        <referenceBlock name="sales_order_items_renderer">
            <action method="setTemplate">
                <argument name="template" translate="true" xsi:type="string">TemplateMonster_Orderitem::order/view/items/renderer/default.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

This my file path fordefault.phtml(

app/code/TemplateMonster/Orderitem/view/adminhtml/templates/order/view/items/renderer/default.phtml

I don't know what is the mistake. Please someone help me

1 Answer 1

0

Below changes apply in app/code/TemplateMonster/Orderitem/etc/module.xml

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

And below is the code for app/code/TemplateMonster/Orderitem/view/adminhtml/layout/sales_order_view.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">    
    <body>
        <referenceBlock name="default_order_items_renderer">
            <action method="setTemplate">
                <argument name="template" translate="true" xsi:type="string">TemplateMonster_Orderitem::order/view/items/renderer/default.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Now run below commands using SSH.

php bin/magento s:up

php bin/magento s:static-content:de -f

chmod -R 777 var/ pub/ generated/

Now, this time you will show an output. And also if this answer will be helpful then don't forget to upvote :)

8
  • Still not showing
    – Amy
    Nov 24, 2018 at 5:36
  • Is there any error you are facing in var/log/exception.log file ? And also have you checked is there any theme used at admin side or what? Nov 24, 2018 at 5:49
  • There is no error in exception.log file
    – Amy
    Nov 24, 2018 at 6:12
  • There is no theme used at admin side
    – Amy
    Nov 24, 2018 at 6:13
  • Possible help I have did. Now, up to you to find solution. Thanks :) Nov 24, 2018 at 6:17

Your Answer

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

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