Summary

In this chapter, we had a look at a powerful feature of Magento called plugins. We created a small module with three plugins; each plugin had a different sort order. This enabled us to trace the execution flow of multiple plugins that observe the same method. We explored in detail the before, after, and around listener methods, while having a strong emphasis on the parameter order. The finalized module used in this chapter can be found at https://github.com/ajzele/B05032-Foggyline_Plugged.

In the next chapter, we are going to dive deep into backend development.

Get Magento 2 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.