1

I can't override the adminhtml block please suggest me missing parameter

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"></pre>
        <preference for="Magento\Sales\Block\Adminhtml\Totals" type="Namespace\Modulename\Block\Adminhtml\Totals" />

        <preference for="Magento\Sales\Controller\Adminhtml\Order" type="Namespace\Modulename\Controller\Adminhtml\Order" />
</config>
5
  • Can you please add your custom block code here Jul 26 '18 at 7:20
  • i have added Block/Adminhtml/Totals.php file but not override Jul 26 '18 at 7:22
  • controller not override using perefence becuse Order class is abstract Jul 26 '18 at 7:23
  • Can you please add code of Block/Adminhtml/Totals.php in your question? Jul 26 '18 at 7:26
  • Thanks for suggestion me but Block not override please suggest me Jul 26 '18 at 7:28
0
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

Add this before the preference tag in place of -

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"></pre>

Also please confirm the di.xml file starts with

<?xml version="1.0"?>

If not worked, share the Block code with path

2
  • Namespace\Modulename\etc\di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> <preference for="Magento\Sales\Block\Adminhtml\Totals" type="Namespace\Modulename\Block\Adminhtml\Totals" /> </config> Namespace\Modulename\Block\Adminhtml\Totals.php Jul 26 '18 at 8:38
  • :D I mean you can edit the question
    – Gagan
    Jul 26 '18 at 9:05

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.