I'm using Virtuemart 3 and Joomla 3, after upgrarding to VM 4 and Joomla 4, it say error Class 'JDispatcher' not found from JROOT/plugins/vmshipment/rules_shipping_advanced/rules_shipping_framework_joomla.php:39

This is the error causing code part:

$dispatcher = JDispatcher::getInstance();
$defs = $dispatcher->trigger('onVmShippingRulesRegisterCustomFunctions',array());

I have done many search on google but no result, can you help?

1 Answer 1


I found a solution, it works.

use Joomla\Event\Dispatcher as EventDispatcher;
$dispatcher = new EventDispatcher();
$defs = $dispatcher->triggerEvent('onVmShippingRulesRegisterCustomFunctions',array());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.