Skip to main content
added 103 characters in body
Source Link
Piyush
  • 5.9k
  • 9
  • 34
  • 66

inside module.xmlInside Module.xml file, you have to declare dependency of core module

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

You have to override your xml file at right place, app/code/Vendor/Modulename/view/adminhtml/layout/sales_order_view.xml

 

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

<?xml version="1.0"?>
 
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    
     <preference for="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer" type="Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer" /> 
</config>

Create DefaultRenderer.php in Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer.

Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer.

<?php
 
namespace Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer;
 
class DefaultRenderer extends \Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer
{

}

inside module.xml file, you have to declare dependency of core module

 

You have override your xml file at right place, app/code/Vendor/Modulename/view/adminhtml/layout/sales_order_view.xml

 

Create DefaultRenderer.php in Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer.

Inside Module.xml file, you have to declare dependency of core module

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

You have to override your xml file at right place,

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

<?xml version="1.0"?>
 
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    
     <preference for="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer" type="Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer" /> 
</config>

Create DefaultRenderer.php in

Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer.

<?php
 
namespace Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer;
 
class DefaultRenderer extends \Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer
{

}
Source Link

inside module.xml file, you have to declare dependency of core module

You have override your xml file at right place, app/code/Vendor/Modulename/view/adminhtml/layout/sales_order_view.xml

Create DefaultRenderer.php in Vendor\Modulename\Block\Adminhtml\Order\View\Items\Renderer.