profile

M Bytes

🟧 M Bytes #8: Magento plugin execution order intricacies


by M.academy​

Hey Reader,

Last week's M Bytes issue was a bit hit! Y'all loved the weekly theme, so we're going to stick with it for the time being (if you don't like it, please let me know in the survey at the end).

I love doing little experiments. You never really know what works until you try it — and this goes for your Magento code as well.

This week, we're talking about plugins. Plugins aren't modules or extensions (please don't say that in a tech interview! 😅), but allow you to easily "plug into" other Magento code.

There are also some weird intricacies with plugin load ordering, especially regarding when (and how) they execute, and as a Magento dev you should definitely be aware of these.

Check it 👇

Keep coding,

Mark Shust

Teacher / M.academy

Say hi 👋 on LinkedIn & YouTube​

Control plugin execution order in Magento

Understanding plugin execution order is CRUCIAL when it comes to customizing Magento code.

Did you know that you can set negative sortOrder values, and they are also super useful?

The Unexpected Behavior of Magento Plugin Execution Order

Just a few minutes ago, I published an article about how Magento plugins may not execute in the order in which you'd expect.

Sneak peek: What's brewing 👀

This is where an image tut usually goes. But this week, I ran out of time.

It's because I've been working on something that I've never been more excited about. I'm combining these atomic lessons, my passion for Magento, and a desire to build something great from my mid-life catalyst.

While I'm actively creating a new Adobe Commerce cert-prep course, I also want to publish a ridiculous amount of new lessons this year. This has been the key driver for this new newsletter format.

I'll be teasing new features throughout the rest of this year, as what I'm creating will take some time to build. But one such feature which can help everyone today is increased internationalization support. You — my students — are an extremely global group, and I want to make my offerings as accessible as possible to everyone around the globe.

I've supported tech-friendly English captions since the start of M.academy, and shortly after added Spanish. Last year, I added Portuguese, French and German languages to all courses — but it was a struggle and very time consuming.

But moving forward, all new lessons will now have tech-friendly closed captions in English, Spanish, French, Portuguese, Italian, Polish, Ukrainian and German. And the translations should be near-perfect, which is something that I haven't been able to accomplish until now, thanks to advances in AI.

I can add hundreds of different languages with perfect translations if needed, as this solution is scalable, but I still need to be mindful of time & resources. So if you have a language that is not in this list that you'd like added, please reply back and let me know.

Also please check out the lesson captions with any of these atomic lessons, and let me know how they look, as they were all just updated yesterday 😄

Bonus: Create an around plugin in Magento

Magento's "before" plugins modify a function's argument values, "after" plugins can change the return result of a function... but what do around plugins do?

Well, they do everything — but here's some reasons why you may not want to use them:

What's the best way to build a custom module?

My Magento 2 Coding Kickstart course walks through all of the best practices when it comes to writing Magento code.

With over 80 lessons 4 hours of content — and you know I don't like fluff — this is jam-packed, focused, and incredibly valuable.

Now only $299.

​

Sent to 9,000+ developers every week

M.academy​
8940 Sassafras Cir, N. Royalton, OH 44133

​Remove me from M Bytes, remove me from everything or manage your profile​

M Bytes

Watch. Read. Apply. One topic every week.

Share this page