4

whats the difference if I place events.xml directly under etc folder , under etc/frontend or etc/adminhtml ?

Suppose I want to capture an event sales_quote_collect_totals_after on both admin & frontend, should I create events.xml in both frontend & adminhtml folders and write the code in both files ?

Or I can just write in the global one and it will work for both ?

1 Answer 1

2

There are not only frontend and backend areas, but also e.g. webapi_rest, webapi_soap. If you define event in the global area, this event will be available for all areas.

Create global event.xml for general cases, unless you want to exclude some specific areas.

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.