Can we override a core plugin
Question
I want to override a core plugin in Magento\Sales\Controller\Order\Plugin -> Authentication.php Is this even possible to achieve.
Solution
After disable core plugin you can override
Vender\Module\etc\di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Sales\Controller\Order\Plugin\Authentication">
<plugin name="authentication" disabled="true" />
<plugin name="vender_module_authentication" type="Vendor\Module\Controller\Order\Plugin\Authentication" sortOrder="60" disabled="false"/>
</type>
</config>
OTHER TIPS
I would advise againts overriding the plugin, but adding your own plugin to that plugin and do your customisation that way. This way you avoid future errors.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange