0

How to create a new action in an admin controller which already exist to call a third party api ? Any idea ?

1 Answer 1

0

As you have mentioned, it is already an existing action and for every action there should be a controller. So as far as i understood , u can do this by changing existing controller.For changing existing controller, there are couple of methods how they can be changed. You can do that by preference, plugin or use “old” style after/before . Preference will change complete controller with your controller code (we can call that like complete rewrite). Plugins will change only desired controlled method. Lastly, after and before will change location of controller for custom front name. Example for this is how you add new controller on admin area.

<router id="admin">
        <route id="catalog" frontName="catalog">
            <module name="Magento_Catalog" before="Magento_Backend" />
        </route>
    </router>

Your Answer

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

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