News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[Resolved] How to fire onVmSiteController event in an extend VM plugin?

Started by MikUrrey, January 15, 2013, 15:58:13 PM

Previous topic - Next topic

MikUrrey

Hi all!
I'am developing an extend VM plugin to filter products on page by special way.
<?php
defined
('_JEXEC') or  die( 'Direct Access to ' basename__FILE__ ) . ' is not allowed.' ) ;

if (!
class_exists('vmExtendedPlugin')) require(JPATH_VM_PLUGINS DS 'vmextendedplugin.php');

class 
plgVmExtendedPcplugin extends vmExtendedPlugin {
public function onVmSiteController($controller){
var_dump($controller);
}
}

From Virtuemart wiki:
QuoteThis event is fired, when the called view was not found in the frontend maincontroller. It allows to add new views to virtuemart 2
But when I go to http://mysite/index.php?option=com_virtuemart&view=some_nonexistent_view, VM redirects me on http://mysite/index.php?option=com_virtuemart.

How is right way to use this feature?

MikUrrey

Found some mistakes.
Inside XML:
<install version="1.5" type="plugin" group="vmextend" >
Right is:
<install version="1.5" type="plugin" group="vmextended" >
Inside PHP: onVmSiteController must declare a class with name VirtueMartControllerViewname what must extends JController, then virtuemart.php redirects on VM index page.