How to pass custom parameters to parent construct?I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Magento 2 Custom Module New Controller IssueHow to override core class which is already overrided by other custom module in Magento 2main.CRITICAL: Plugin class doesn't exist__construct() argument error when overriding 2 custom modules from same core moduleMagento 2 admin form controller errorMagento 2.2.0 - __construct() must be an instance of MagentoFrameworkViewResultPageFactory,Magento 2.3 Can't view module's front end page output?Unable to Serialize Value Magento 2.2.6Unable to serialize value problem with Magento 2.2.6

How can I determine if the org that I'm currently connected to is a scratch org?

Cursor Replacement for Newbies

How badly should I try to prevent a user from XSSing themselves?

Expand and Contract

Size of subfigure fitting its content (tikzpicture)

Intersection Puzzle

Should I tell management that I intend to leave due to bad software development practices?

What exploit Are these user agents trying to use?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Personal Teleportation: From Rags to Riches

Watching something be piped to a file live with tail

What is a romance in Latin?

Can I run a new neutral wire to repair a broken circuit?

Short story with a alien planet, government officials must wear exploding medallions

What method can I use to design a dungeon difficult enough that the PCs can't make it through without killing them?

Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

How do conventional missiles fly?

Why would the Red Woman birth a shadow if she worshipped the Lord of the Light?

How to Recreate this in LaTeX? (Unsure What the Notation is Called)

Avoiding the "not like other girls" trope?

Is there a hemisphere-neutral way of specifying a season?

Is "remove commented out code" correct English?



How to pass custom parameters to parent construct?


I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Magento 2 Custom Module New Controller IssueHow to override core class which is already overrided by other custom module in Magento 2main.CRITICAL: Plugin class doesn't exist__construct() argument error when overriding 2 custom modules from same core moduleMagento 2 admin form controller errorMagento 2.2.0 - __construct() must be an instance of MagentoFrameworkViewResultPageFactory,Magento 2.3 Can't view module's front end page output?Unable to Serialize Value Magento 2.2.6Unable to serialize value problem with Magento 2.2.6













0















I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);











share|improve this question
























  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago















0















I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);











share|improve this question
























  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago













0












0








0








I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);











share|improve this question
















I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);








magento2 construct






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 20 hours ago









ABHISHEK TRIPATHI

2,0611728




2,0611728










asked 21 hours ago









Vamsy KrishnaVamsy Krishna

111




111












  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago

















  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago
















you have to define _httpClientFactory before your constructor

– magefms
21 hours ago





you have to define _httpClientFactory before your constructor

– magefms
21 hours ago













like protected $_httpClientFactory

– magefms
21 hours ago





like protected $_httpClientFactory

– magefms
21 hours ago













I have defined also like protected $_httpClientFactory , but it is not working

– Vamsy Krishna
20 hours ago





I have defined also like protected $_httpClientFactory , but it is not working

– Vamsy Krishna
20 hours ago













what error did you get?

– magefms
20 hours ago





what error did you get?

– magefms
20 hours ago













why do you need this _httpClientFactory?

– magefms
20 hours ago





why do you need this _httpClientFactory?

– magefms
20 hours ago










2 Answers
2






active

oldest

votes


















0














You can try like this



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @var MagentoFrameworkHTTPZendClientFactory
*/
protected $_httpClientFactory;

/**
* @var MagentoFrameworkObjectManagerInterface
*/
protected $_objectManager;

/**
* Custom constructor.
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
* @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
* @param MagentoFrameworkObjectManagerInterface $objectmanager
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
MagentoFrameworkObjectManagerInterface $objectmanager
)
$this->layoutFactory = $layoutFactory;
$this->_httpClientFactory = $httpClientFactory;
$this->_objectManager = $objectmanager;
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);


public function execute()

//you execute logic here







share|improve this answer























  • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

    – Vamsy Krishna
    16 hours ago











  • not able to add/ override constructor properly

    – Vamsy Krishna
    15 hours ago


















0














I think you are forgetting to add use statement for certain classes like




ActionContext $context,



OrderManagementInterface $orderManagement,



OrderRepositoryInterface $orderRepository




etc. Also, I'm not able to see any namespace for your class.
Your file should look like below.



<?php

namespace [Vendors][Module]ControllerAdminhtml;

use MagentoBackendAppAction;
use MagentoSalesApiOrderManagementInterface;
use MagentoSalesApiOrderRepositoryInterface;
use MagentoFrameworkExceptionNoSuchEntityException;
use MagentoFrameworkExceptionInputException;
use PsrLogLoggerInterface;

class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
MagentoFrameworkHTTPZendClientFactory $httpClientFactory
)
$this->layoutFactory = $layoutFactory;
$this->_httpClientFactory = $httpClientFactory;
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);




Try this. After making changes clear generated folder and flush cache. It may work for you.






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%2f268455%2fhow-to-pass-custom-parameters-to-parent-construct%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here







    share|improve this answer























    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago















    0














    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here







    share|improve this answer























    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago













    0












    0








    0







    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here







    share|improve this answer













    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here








    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 17 hours ago









    magefmsmagefms

    2,3052426




    2,3052426












    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago

















    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago
















    getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

    – Vamsy Krishna
    16 hours ago





    getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

    – Vamsy Krishna
    16 hours ago













    not able to add/ override constructor properly

    – Vamsy Krishna
    15 hours ago





    not able to add/ override constructor properly

    – Vamsy Krishna
    15 hours ago













    0














    I think you are forgetting to add use statement for certain classes like




    ActionContext $context,



    OrderManagementInterface $orderManagement,



    OrderRepositoryInterface $orderRepository




    etc. Also, I'm not able to see any namespace for your class.
    Your file should look like below.



    <?php

    namespace [Vendors][Module]ControllerAdminhtml;

    use MagentoBackendAppAction;
    use MagentoSalesApiOrderManagementInterface;
    use MagentoSalesApiOrderRepositoryInterface;
    use MagentoFrameworkExceptionNoSuchEntityException;
    use MagentoFrameworkExceptionInputException;
    use PsrLogLoggerInterface;

    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    *
    * @SuppressWarnings(PHPMD.ExcessiveParameterList)
    * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );




    Try this. After making changes clear generated folder and flush cache. It may work for you.






    share|improve this answer





























      0














      I think you are forgetting to add use statement for certain classes like




      ActionContext $context,



      OrderManagementInterface $orderManagement,



      OrderRepositoryInterface $orderRepository




      etc. Also, I'm not able to see any namespace for your class.
      Your file should look like below.



      <?php

      namespace [Vendors][Module]ControllerAdminhtml;

      use MagentoBackendAppAction;
      use MagentoSalesApiOrderManagementInterface;
      use MagentoSalesApiOrderRepositoryInterface;
      use MagentoFrameworkExceptionNoSuchEntityException;
      use MagentoFrameworkExceptionInputException;
      use PsrLogLoggerInterface;

      class Custom extends MagentoSalesControllerAdminhtmlOrder

      /**
      * @var MagentoFrameworkViewLayoutFactory
      */
      protected $layoutFactory;

      /**
      * @param ActionContext $context
      * @param MagentoFrameworkRegistry $coreRegistry
      * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
      * @param MagentoFrameworkTranslateInlineInterface $translateInline
      * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
      * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
      * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
      * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
      * @param OrderManagementInterface $orderManagement
      * @param OrderRepositoryInterface $orderRepository
      * @param LoggerInterface $logger
      * @param MagentoFrameworkViewLayoutFactory $layoutFactory
      *
      * @SuppressWarnings(PHPMD.ExcessiveParameterList)
      * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
      */
      public function __construct(
      ActionContext $context,
      MagentoFrameworkRegistry $coreRegistry,
      MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
      MagentoFrameworkTranslateInlineInterface $translateInline,
      MagentoFrameworkViewResultPageFactory $resultPageFactory,
      MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
      MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
      MagentoFrameworkControllerResultRawFactory $resultRawFactory,
      OrderManagementInterface $orderManagement,
      OrderRepositoryInterface $orderRepository,
      LoggerInterface $logger,
      MagentoFrameworkViewLayoutFactory $layoutFactory,
      MagentoFrameworkHTTPZendClientFactory $httpClientFactory
      )
      $this->layoutFactory = $layoutFactory;
      $this->_httpClientFactory = $httpClientFactory;
      parent::__construct(
      $context,
      $coreRegistry,
      $fileFactory,
      $translateInline,
      $resultPageFactory,
      $resultJsonFactory,
      $resultLayoutFactory,
      $resultRawFactory,
      $orderManagement,
      $orderRepository,
      $logger
      );




      Try this. After making changes clear generated folder and flush cache. It may work for you.






      share|improve this answer



























        0












        0








        0







        I think you are forgetting to add use statement for certain classes like




        ActionContext $context,



        OrderManagementInterface $orderManagement,



        OrderRepositoryInterface $orderRepository




        etc. Also, I'm not able to see any namespace for your class.
        Your file should look like below.



        <?php

        namespace [Vendors][Module]ControllerAdminhtml;

        use MagentoBackendAppAction;
        use MagentoSalesApiOrderManagementInterface;
        use MagentoSalesApiOrderRepositoryInterface;
        use MagentoFrameworkExceptionNoSuchEntityException;
        use MagentoFrameworkExceptionInputException;
        use PsrLogLoggerInterface;

        class Custom extends MagentoSalesControllerAdminhtmlOrder

        /**
        * @var MagentoFrameworkViewLayoutFactory
        */
        protected $layoutFactory;

        /**
        * @param ActionContext $context
        * @param MagentoFrameworkRegistry $coreRegistry
        * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
        * @param MagentoFrameworkTranslateInlineInterface $translateInline
        * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
        * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
        * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
        * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
        * @param OrderManagementInterface $orderManagement
        * @param OrderRepositoryInterface $orderRepository
        * @param LoggerInterface $logger
        * @param MagentoFrameworkViewLayoutFactory $layoutFactory
        *
        * @SuppressWarnings(PHPMD.ExcessiveParameterList)
        * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
        */
        public function __construct(
        ActionContext $context,
        MagentoFrameworkRegistry $coreRegistry,
        MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
        MagentoFrameworkTranslateInlineInterface $translateInline,
        MagentoFrameworkViewResultPageFactory $resultPageFactory,
        MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
        MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
        MagentoFrameworkControllerResultRawFactory $resultRawFactory,
        OrderManagementInterface $orderManagement,
        OrderRepositoryInterface $orderRepository,
        LoggerInterface $logger,
        MagentoFrameworkViewLayoutFactory $layoutFactory,
        MagentoFrameworkHTTPZendClientFactory $httpClientFactory
        )
        $this->layoutFactory = $layoutFactory;
        $this->_httpClientFactory = $httpClientFactory;
        parent::__construct(
        $context,
        $coreRegistry,
        $fileFactory,
        $translateInline,
        $resultPageFactory,
        $resultJsonFactory,
        $resultLayoutFactory,
        $resultRawFactory,
        $orderManagement,
        $orderRepository,
        $logger
        );




        Try this. After making changes clear generated folder and flush cache. It may work for you.






        share|improve this answer















        I think you are forgetting to add use statement for certain classes like




        ActionContext $context,



        OrderManagementInterface $orderManagement,



        OrderRepositoryInterface $orderRepository




        etc. Also, I'm not able to see any namespace for your class.
        Your file should look like below.



        <?php

        namespace [Vendors][Module]ControllerAdminhtml;

        use MagentoBackendAppAction;
        use MagentoSalesApiOrderManagementInterface;
        use MagentoSalesApiOrderRepositoryInterface;
        use MagentoFrameworkExceptionNoSuchEntityException;
        use MagentoFrameworkExceptionInputException;
        use PsrLogLoggerInterface;

        class Custom extends MagentoSalesControllerAdminhtmlOrder

        /**
        * @var MagentoFrameworkViewLayoutFactory
        */
        protected $layoutFactory;

        /**
        * @param ActionContext $context
        * @param MagentoFrameworkRegistry $coreRegistry
        * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
        * @param MagentoFrameworkTranslateInlineInterface $translateInline
        * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
        * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
        * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
        * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
        * @param OrderManagementInterface $orderManagement
        * @param OrderRepositoryInterface $orderRepository
        * @param LoggerInterface $logger
        * @param MagentoFrameworkViewLayoutFactory $layoutFactory
        *
        * @SuppressWarnings(PHPMD.ExcessiveParameterList)
        * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
        */
        public function __construct(
        ActionContext $context,
        MagentoFrameworkRegistry $coreRegistry,
        MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
        MagentoFrameworkTranslateInlineInterface $translateInline,
        MagentoFrameworkViewResultPageFactory $resultPageFactory,
        MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
        MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
        MagentoFrameworkControllerResultRawFactory $resultRawFactory,
        OrderManagementInterface $orderManagement,
        OrderRepositoryInterface $orderRepository,
        LoggerInterface $logger,
        MagentoFrameworkViewLayoutFactory $layoutFactory,
        MagentoFrameworkHTTPZendClientFactory $httpClientFactory
        )
        $this->layoutFactory = $layoutFactory;
        $this->_httpClientFactory = $httpClientFactory;
        parent::__construct(
        $context,
        $coreRegistry,
        $fileFactory,
        $translateInline,
        $resultPageFactory,
        $resultJsonFactory,
        $resultLayoutFactory,
        $resultRawFactory,
        $orderManagement,
        $orderRepository,
        $logger
        );




        Try this. After making changes clear generated folder and flush cache. It may work for you.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 9 hours ago









        Ansuman

        486




        486










        answered 10 hours ago









        Yash ShahYash Shah

        68618




        68618



























            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%2f268455%2fhow-to-pass-custom-parameters-to-parent-construct%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?