Question

Is it possible to create a plugin for an existing plugin class in Magento 2.3.5-p2 and if so, are there any special ways of doing this besides the normal plugin creation?

Was it helpful?

Solution

Yes It's Possible possible to create a plugin for an existing plugin class .

The sortOrder property from the plugin node declared in di.xml determines the plugin’s prioritization when more than one plugin is observing the same method.

like this

<config>
    <type name="Magento\Framework\App\Action\Action">
        <plugin name="vendor_module_plugina" type="Vendor\Module\Plugin\PluginA" sortOrder="10" />
        <plugin name="vendor_module_pluginb" type="Vendor\Module\Plugin\PluginB" sortOrder="20" />
        <plugin name="vendor_module_pluginc" type="Vendor\Module\Plugin\PluginC" sortOrder="30" />
    </type>
</config>

For More Click Here

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top