Magento 2.2.5: Overriding Admin Controller sales/orderHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlMagento 2 - Got Error in Adminhtml ControllerExtending magento sales order controller not workingmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?How can I override admin create order controller?Magento 2 add tab to sales order not working for Magento ver. 2.2.3Magento 2.2.5: Add, Update and Delete existing products Custom Options

Is there an application which does HTTP PUT?

How long can fsck take on a 30 TB volume?

How is it believable that Euron could so easily pull off this ambush?

Is this strange Morse signal type common?

Why did Missandei say this?

How do I politely tell my players to shut up about their backstory?

Align a table column at a specific symbol

What is the oldest instrument ever?

How do I give a darkroom course without negatives from the attendees?

Why doesn't increasing the temperature of something like wood or paper set them on fire?

What happens when the drag force exceeds the weight of an object falling into earth?

Examples where existence is harder than evaluation

Steganography in Latex

How can it be that ssh somename works, while nslookup somename does not?

How to start your Starctaft II games vs AI immediatly?

99 coins into the sacks

What's the difference between "ricochet" and "bounce"?

How would an instant or sorcery with an effect that targets work with Feather?

Employee is self-centered and affects the team negatively

Why does this pattern in powers happen?

Why did Ham the Chimp push levers?

How do I minimise waste on a flight?

Mindfulness of Watching Youtube

Gift for mentor after his thesis defense?



Magento 2.2.5: Overriding Admin Controller sales/order


How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlMagento 2 - Got Error in Adminhtml ControllerExtending magento sales order controller not workingmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?How can I override admin create order controller?Magento 2 add tab to sales order not working for Magento ver. 2.2.3Magento 2.2.5: Add, Update and Delete existing products Custom Options






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I need to override Admin sales/order/index controller, but still getting 404. Below the Steps I take to override -



Created My Custom Module
app/code/A2bizz/Order/registration.php




<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'A2bizz_Order',
__DIR__
);


app/code/A2bizz/Order/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="A2bizz_Order" setup_version="2.0.0" schema_version="2.0.0">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Rule"/>
<module name="Magento_Catalog"/>
<module name="Magento_Customer"/>
<module name="Magento_Payment"/>
<module name="Magento_SalesSequence"/>
</sequence>
</module>
</config>


app/code/A2bizz/Order/Controller/Adminhtml/Order/Index.php




<?php

namespace A2bizzOrderControllerAdminhtmlOrder;

class Index extends MagentoSalesControllerAdminhtmlOrderIndex

public function execute()

$this->messageManager->addSuccess('Message from new admin controller.');
// Do your stuff here
return parent::execute();




app/code/A2bizz/Order/etc/adminhtml/di.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="MagentoSalesControllerAdminhtmlOrderIndex"
type="A2bizzOrderControllerAdminhtmlOrderIndex" />
</config>


if anyone can help me on what I am doing wrong.
Thanks










share|improve this question






















  • check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml

    – Vishnunath
    Jul 14 '18 at 9:13

















1















I need to override Admin sales/order/index controller, but still getting 404. Below the Steps I take to override -



Created My Custom Module
app/code/A2bizz/Order/registration.php




<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'A2bizz_Order',
__DIR__
);


app/code/A2bizz/Order/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="A2bizz_Order" setup_version="2.0.0" schema_version="2.0.0">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Rule"/>
<module name="Magento_Catalog"/>
<module name="Magento_Customer"/>
<module name="Magento_Payment"/>
<module name="Magento_SalesSequence"/>
</sequence>
</module>
</config>


app/code/A2bizz/Order/Controller/Adminhtml/Order/Index.php




<?php

namespace A2bizzOrderControllerAdminhtmlOrder;

class Index extends MagentoSalesControllerAdminhtmlOrderIndex

public function execute()

$this->messageManager->addSuccess('Message from new admin controller.');
// Do your stuff here
return parent::execute();




app/code/A2bizz/Order/etc/adminhtml/di.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="MagentoSalesControllerAdminhtmlOrderIndex"
type="A2bizzOrderControllerAdminhtmlOrderIndex" />
</config>


if anyone can help me on what I am doing wrong.
Thanks










share|improve this question






















  • check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml

    – Vishnunath
    Jul 14 '18 at 9:13













1












1








1








I need to override Admin sales/order/index controller, but still getting 404. Below the Steps I take to override -



Created My Custom Module
app/code/A2bizz/Order/registration.php




<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'A2bizz_Order',
__DIR__
);


app/code/A2bizz/Order/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="A2bizz_Order" setup_version="2.0.0" schema_version="2.0.0">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Rule"/>
<module name="Magento_Catalog"/>
<module name="Magento_Customer"/>
<module name="Magento_Payment"/>
<module name="Magento_SalesSequence"/>
</sequence>
</module>
</config>


app/code/A2bizz/Order/Controller/Adminhtml/Order/Index.php




<?php

namespace A2bizzOrderControllerAdminhtmlOrder;

class Index extends MagentoSalesControllerAdminhtmlOrderIndex

public function execute()

$this->messageManager->addSuccess('Message from new admin controller.');
// Do your stuff here
return parent::execute();




app/code/A2bizz/Order/etc/adminhtml/di.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="MagentoSalesControllerAdminhtmlOrderIndex"
type="A2bizzOrderControllerAdminhtmlOrderIndex" />
</config>


if anyone can help me on what I am doing wrong.
Thanks










share|improve this question














I need to override Admin sales/order/index controller, but still getting 404. Below the Steps I take to override -



Created My Custom Module
app/code/A2bizz/Order/registration.php




<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'A2bizz_Order',
__DIR__
);


app/code/A2bizz/Order/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="A2bizz_Order" setup_version="2.0.0" schema_version="2.0.0">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Rule"/>
<module name="Magento_Catalog"/>
<module name="Magento_Customer"/>
<module name="Magento_Payment"/>
<module name="Magento_SalesSequence"/>
</sequence>
</module>
</config>


app/code/A2bizz/Order/Controller/Adminhtml/Order/Index.php




<?php

namespace A2bizzOrderControllerAdminhtmlOrder;

class Index extends MagentoSalesControllerAdminhtmlOrderIndex

public function execute()

$this->messageManager->addSuccess('Message from new admin controller.');
// Do your stuff here
return parent::execute();




app/code/A2bizz/Order/etc/adminhtml/di.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="MagentoSalesControllerAdminhtmlOrderIndex"
type="A2bizzOrderControllerAdminhtmlOrderIndex" />
</config>


if anyone can help me on what I am doing wrong.
Thanks







magento2 overrides admin-controller






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 14 '18 at 7:42









amit_gameamit_game

9221329




9221329












  • check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml

    – Vishnunath
    Jul 14 '18 at 9:13

















  • check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml

    – Vishnunath
    Jul 14 '18 at 9:13
















check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml

– Vishnunath
Jul 14 '18 at 9:13





check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml

– Vishnunath
Jul 14 '18 at 9:13










1 Answer
1






active

oldest

votes


















0














It is recommendable use the plugin instead of preference for this.



https://devdocs.magento.com/guides/v2.2/extension-dev-guide/plugins.html



You must do the next.




Vendor/Namespace/etc/di.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoSalesControllerAdminhtmlOrderIndex">
<plugin name="vendor_namespace_plugin_list" type="VendorNamespacePluginControllerOrderIndexPlugin"/>
</type>



Vendor/Namespace/Plugin/ControllerOrderIndexPlugin.php




<?php

namespace VendorNamespacePlugin;

use MagentoFrameworkMessageManagerInterface;
use MagentoSalesControllerAdminhtmlOrderIndex;

/**
* Class ControllerOrderIndexPlugin
*/
class ControllerOrderIndexPlugin


/**
* @var ManagerInterface
*/
private $messageManager;

/**
* ControllerOrderIndexPlugin constructor.
*
* @param ManagerInterface $messageManager
*/
public function __construct(ManagerInterface $messageManager)

$this->messageManager = $messageManager;


/**
* @param Index $subject
*/
public function beforeExecute(
Index $subject
)
$this->messageManager->addSuccessMessage(__('Message from new admin controller.'));







share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f233540%2fmagento-2-2-5-overriding-admin-controller-sales-order%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It is recommendable use the plugin instead of preference for this.



    https://devdocs.magento.com/guides/v2.2/extension-dev-guide/plugins.html



    You must do the next.




    Vendor/Namespace/etc/di.xml




    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="MagentoSalesControllerAdminhtmlOrderIndex">
    <plugin name="vendor_namespace_plugin_list" type="VendorNamespacePluginControllerOrderIndexPlugin"/>
    </type>



    Vendor/Namespace/Plugin/ControllerOrderIndexPlugin.php




    <?php

    namespace VendorNamespacePlugin;

    use MagentoFrameworkMessageManagerInterface;
    use MagentoSalesControllerAdminhtmlOrderIndex;

    /**
    * Class ControllerOrderIndexPlugin
    */
    class ControllerOrderIndexPlugin


    /**
    * @var ManagerInterface
    */
    private $messageManager;

    /**
    * ControllerOrderIndexPlugin constructor.
    *
    * @param ManagerInterface $messageManager
    */
    public function __construct(ManagerInterface $messageManager)

    $this->messageManager = $messageManager;


    /**
    * @param Index $subject
    */
    public function beforeExecute(
    Index $subject
    )
    $this->messageManager->addSuccessMessage(__('Message from new admin controller.'));







    share|improve this answer



























      0














      It is recommendable use the plugin instead of preference for this.



      https://devdocs.magento.com/guides/v2.2/extension-dev-guide/plugins.html



      You must do the next.




      Vendor/Namespace/etc/di.xml




      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
      <type name="MagentoSalesControllerAdminhtmlOrderIndex">
      <plugin name="vendor_namespace_plugin_list" type="VendorNamespacePluginControllerOrderIndexPlugin"/>
      </type>



      Vendor/Namespace/Plugin/ControllerOrderIndexPlugin.php




      <?php

      namespace VendorNamespacePlugin;

      use MagentoFrameworkMessageManagerInterface;
      use MagentoSalesControllerAdminhtmlOrderIndex;

      /**
      * Class ControllerOrderIndexPlugin
      */
      class ControllerOrderIndexPlugin


      /**
      * @var ManagerInterface
      */
      private $messageManager;

      /**
      * ControllerOrderIndexPlugin constructor.
      *
      * @param ManagerInterface $messageManager
      */
      public function __construct(ManagerInterface $messageManager)

      $this->messageManager = $messageManager;


      /**
      * @param Index $subject
      */
      public function beforeExecute(
      Index $subject
      )
      $this->messageManager->addSuccessMessage(__('Message from new admin controller.'));







      share|improve this answer

























        0












        0








        0







        It is recommendable use the plugin instead of preference for this.



        https://devdocs.magento.com/guides/v2.2/extension-dev-guide/plugins.html



        You must do the next.




        Vendor/Namespace/etc/di.xml




        <?xml version="1.0"?>
        <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <type name="MagentoSalesControllerAdminhtmlOrderIndex">
        <plugin name="vendor_namespace_plugin_list" type="VendorNamespacePluginControllerOrderIndexPlugin"/>
        </type>



        Vendor/Namespace/Plugin/ControllerOrderIndexPlugin.php




        <?php

        namespace VendorNamespacePlugin;

        use MagentoFrameworkMessageManagerInterface;
        use MagentoSalesControllerAdminhtmlOrderIndex;

        /**
        * Class ControllerOrderIndexPlugin
        */
        class ControllerOrderIndexPlugin


        /**
        * @var ManagerInterface
        */
        private $messageManager;

        /**
        * ControllerOrderIndexPlugin constructor.
        *
        * @param ManagerInterface $messageManager
        */
        public function __construct(ManagerInterface $messageManager)

        $this->messageManager = $messageManager;


        /**
        * @param Index $subject
        */
        public function beforeExecute(
        Index $subject
        )
        $this->messageManager->addSuccessMessage(__('Message from new admin controller.'));







        share|improve this answer













        It is recommendable use the plugin instead of preference for this.



        https://devdocs.magento.com/guides/v2.2/extension-dev-guide/plugins.html



        You must do the next.




        Vendor/Namespace/etc/di.xml




        <?xml version="1.0"?>
        <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <type name="MagentoSalesControllerAdminhtmlOrderIndex">
        <plugin name="vendor_namespace_plugin_list" type="VendorNamespacePluginControllerOrderIndexPlugin"/>
        </type>



        Vendor/Namespace/Plugin/ControllerOrderIndexPlugin.php




        <?php

        namespace VendorNamespacePlugin;

        use MagentoFrameworkMessageManagerInterface;
        use MagentoSalesControllerAdminhtmlOrderIndex;

        /**
        * Class ControllerOrderIndexPlugin
        */
        class ControllerOrderIndexPlugin


        /**
        * @var ManagerInterface
        */
        private $messageManager;

        /**
        * ControllerOrderIndexPlugin constructor.
        *
        * @param ManagerInterface $messageManager
        */
        public function __construct(ManagerInterface $messageManager)

        $this->messageManager = $messageManager;


        /**
        * @param Index $subject
        */
        public function beforeExecute(
        Index $subject
        )
        $this->messageManager->addSuccessMessage(__('Message from new admin controller.'));








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 15 '18 at 19:27









        raumatbelraumatbel

        733414




        733414



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f233540%2fmagento-2-2-5-overriding-admin-controller-sales-order%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?