I'm trying to do this:

<type name="Magento\Payment\Model\MethodList">
    <plugin name="a_name_plugin" type="Mynamespace\Mymodule\Plugin\Model\Payment\MethodList\Plugin" sortOrder="10"/>

It isn't activated if I place this declaration in etc/frontend/di.xml. But it works in etc/di.xml. I want it to be active only on frontend.

Why it would not work from etc/frontend/di.xml or how to make it work ?

Using Magento 2.0.7 Magento mode is developer. Cache should not be a problem. var/generation/* was cleaned a few times.

Thank you

1 Answer 1


most probably you are not actually in the frontend area: try putting it into etc/webapi_rest/di.xml

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.