I'm creating a Core override plugin(for overriding the 3r party extension) using Joomla system plugin.
The issue is Cannot redeclare class VirtueMartCart error showing on t3 framework based template.
The Joomla version is 3.3.6 and VM 3.0.2.
The same plugin works fine on fresh installation but it return the error on this T3 based existing site. I tried to switch template but same issue . I think some other plugin is casing the issue any idea ? :(
System Plugin Override Approach.
class plgSystemComVirtuemartOverride extends JPlugin{
public function __construct(&$subject, $config = array()) {
parent::__construct($subject, $config);
}
public function onAfterRoute () {
$app = JFactory::getApplication();
if('com_virtuemart' == JRequest::getCMD('option') && !$app->isAdmin()) {
$template = $app->getTemplate();
require_once(JPATH_SITE.'/templates/'.$template.'/code/com_virtuemart/helpers/cart.php');
}
}
}