Zend certified PHP/Magento developer

Override/disable 3rd party plugin (Amasty Shop By) which is not declared

I’ve been battling with this one for a while but can’t figure out how to disable, in order to override, a plugin in the Amasty Shop by extension. I need to override a couple of methods in the plugin, but as they’re set to private and use private variables declared within the class, I think I have to just disable that specific plugin and override it with my own.

The issue I have is that the plugin doesn’t appear to be declared/named in the di.xml files present in the extension, but there are some additional plugins in the extension which extend it, and these plugins are named in di.xml.

The plugin I am trying to override is here: vendor/amasty/shopby/Plugin/Ajax/Ajax.php

There are 2 plugins (in the same directory as the above) which extend it, and are named in vendor/amasty/shopby/etc/frontend/di.xml as below:

I’ve created and registered my module, and my attempt to disable and override the plugin is as follows:



It’s likely I’m missing something obvious here, grateful for any pointers in the right direction.