How to override
Magento\Sales\Controller\Adminhtml\Order\Create\Save.php
the file can you please help me out?
app/code/StackExchange/ControllerOverride/composer.json
{
"name": "stackexchange/controlleroverride",
"description": "StackExchange ControllerOverride",
"require": {
"php": "~5.6.0|7.0.2|~7.0.6",
"magento/module-store": "0.74.0-beta4",
"magento/module-theme": "0.74.0-beta4",
"magento/module-widget": "0.74.0-beta4",
"magento/module-backend": "0.74.0-beta4",
"magento/module-catalog": "0.74.0-beta4",
"magento/module-email": "0.74.0-beta4",
"magento/module-ui": "0.74.0-beta4",
"magento/module-variable": "0.74.0-beta4",
"magento/module-media-storage": "0.74.0-beta4",
"magento/framework": "0.74.0-beta4",
"magento/magento-composer-installer": "*"
},
"type": "magento2-module",
"version": "0.74.0-beta4",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"extra": {
"map": [
[
"*",
"StackExchange/ControllerOverride"
]
]
}
}
app/code/StackExchange/ControllerOverride/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'StackExchange_ControllerOverride',
__DIR__
);
app/code/StackExchange/ControllerOverride/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">
<preference for="Magento\Sales\Controller\Adminhtml\Order\Create\Save" type="StackExchange\ControllerOverride\Controller\Magento\Sales\Adminhtml\Order\Create\Save" />
</config>
app/code/StackExchange/ControllerOverride/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="StackExchange_ControllerOverride" setup_version="1.0.0">
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
<module name="Magento_Cms"/>
</sequence>
</module>
</config>
app/code/StackExchange/ControllerOverride/Controller/Magento/Sales/Adminhtml/Order/Create/Save.php
<?php
namespace StackExchange\ControllerOverride\Controller\Magento\Sales\Adminhtml\Order\Create;
class Save extends \Magento\Sales\Controller\Adminhtml\Order\Create\Save
{
}
EDIT
If you want order ID after place order, you can use observer as per below tutorial.
https://meetanshi.com/blog/get-order-data-from-magento-2-sales_order_place_after-event/
sales_order
(state
, status
Commented
Nov 6, 2018 at 10:03
sales_order
(state
, status
Commented
Nov 6, 2018 at 10:12