I want to override abstract class Magento\Sales\Controller\Adminhtml\Order\Create of the below method

protected function _processActionData($action = null){


I have tried using preference but it is not working.

Can anybody help me with this?

2 Answers 2


Preferences don't work for abstract classes because the abstract classes are never instantiated. But you can use preferences for the classes that extend the Magento\Sales\Controller\Adminhtml\Order\Create class.

  • Thanks for the answer. can you share an example of it? Dec 4, 2020 at 9:49

Use a preference to tell Magento which class to use in place of the vendor class Magento\Sales\Controller\Adminhtml\Order\Create (I suppose you're creating a module named Module at the path app/code/Custom/Module):

<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectMamager/etc/config.xsd">
    <preference type="Custom\Module\Controller\Adminhtml\Order\Create" for="Magento\Sales\Controller\Adminhtml\Order\Create"/>

Then, create the file app/code/Custom/Module/Controller/Adminhtml/Order/Create.php:


namespace Custom\Module\Controller\Adminhtml\Order;

use Magento\Sales\Controller\Adminhtml\Order\Create as MagentoCreate;

abstract class Create extends MagentoCreate
    protected function _processActionData($action = null){
        // here your code

Finally, run bin:magento setup:upgrade.

  • it is not working hay you checked? Dec 15, 2020 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.