Magento 2 – Virtual Types Plugins

magento-2.1magento2pluginvirtualtype

I'm confused by Magento 2 documentation regarding plugins:

enter image description here

It is first said that:

Plugins cannot be used with virtual types

But then it is said that:

You can specify a class, interface, or virtual type as a type name
which the plugin observes

Am I missing something or is the documentation contradicting itself ? Can we create plugins for virtual types ?

Best Answer

Plugins will work for virtual type but only if you specify it for parent classes or interfaces, but you cannot specify plugin specific for concrete virtual type

Related Topic