Adding a DI interceptor plugin

In general with Magento 2, it is possible to override public methods of a given class by creating a DI plugin (aka an interceptor with methods prefixes like before, after and around). This mechanism can be applied as well to classes within LokiCheckout extensions. For instance, by modifying repositories and ViewModels that are attached to Loki Components.

The only word of warning here is that code might change: Intercepting methods that are also part of the parent interfaces is safe, because those methods are meant to remain backwards compatible. However, other methods might change. If you would like to make modifications on this level, first make sure to contact the core development team to see if such a change can be possibly created in a different way.

Last modified: April 1, 2025