I am trying to override an abstract class vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php
using di.xml
but it is not working.
I need to do some changes in method protected function _processActionData($action = null)
.
/vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php
namespace Magento\Sales\Controller\Adminhtml\Order;
abstract class Create extends \Magento\Backend\App\Action
{
protected function _processActionData($action = null)
{ ....
}
/app/code/CustomAPI/Product/etc/di.xml
<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" type="CustomAPI\Product\Controller\Adminhtml\Order\Create" />
</config>
/app/code/CustomAPI/Product/Controller/Adminhtml/Order/Create.php
namespace CustomAPI\Product\Controller\Adminhtml\Order
class Create extends Magento\Sales\Controller\Adminhtml\Order\Create
{
$this->_eventManager->dispatch('adminhtml_sales_order_create_process_data_before', $eventData);
_processActionData