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;
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
add a comment |
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
check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml
– Vishnunath
Jul 14 '18 at 9:13
add a comment |
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
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
magento2 overrides admin-controller
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.'));
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.'));
add a comment |
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.'));
add a comment |
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.'));
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.'));
answered Jul 15 '18 at 19:27
raumatbelraumatbel
733414
733414
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
check any other custom modules using this <sequence> <module name="Magento_Sales"/> in module.xml
– Vishnunath
Jul 14 '18 at 9:13