VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: revo1 on April 09, 2012, 14:48:10 PM

Title: load with url vmshipment plugin(AJAX)
Post by: revo1 on April 09, 2012, 14:48:10 PM
HeY!
I just want to know it's possible to load vmshipment plugin called asd with url like that:
index.php?option=com_virtuemart&task=asd&view=function_in_asd_plugin&var1=something&var2=something_else

I want make ajax load for my plugin, but i have this plugin load problem.
scenario:
if i select something in first selection menu, then appear other and i can select there some values.


Thanks!
Title: Re: load with url vmshipment plugin(AJAX)
Post by: Milbo on April 09, 2012, 23:27:08 PM
yes, the controller is plugin
Title: Re: load with url vmshipment plugin(AJAX)
Post by: Studio 42 on April 10, 2012, 00:04:10 AM
To ajaxify your plugin you must always use same "entry"
for eg.

JURI::root().'index.php?option=com_virtuemart&view=plugin&type=vmshipment&name=YOURPLUGINNAME&my_id=10&myparam=test ......

explain :
type=vmshipment  :  because is shipment
name=YOURPLUGINNAME  : because you want call your plugin
you must include in your plugin a function

function plgVmOnSelfCallFE($type, $name, &$render) {
if ($name != $this->_name || $type != 'vmshipment') return false;
// my nice code here
$render="mytext to render";
}

plgVmOnSelfCallFE is in FE

plgVmOnSelfCallBE is in BE
if you want it in json format, you must simply add format=json in the url(or in post);


Title: Re: load with url vmshipment plugin(AJAX)
Post by: revo1 on April 10, 2012, 10:36:14 AM
Fatal error: Class 'VirtuemartControllerPlugin' not found in ...../virtuemart.php line 70:

Line 70:
$_class = 'VirtuemartController'.ucfirst($_controller);


where i can find this class?