VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Rsn on July 27, 2020, 07:41:24 AM

Title: Plugin event for editing/deleting product category
Post by: Rsn on July 27, 2020, 07:41:24 AM
Hello colleagues.

Please, orient me:
Is there a trigger for joomla plugins when saving/deleting VM category?

If this is not yet available, maybe it should be implemented?

I would like to be able to make a plugin for such an event.
Title: Re: Plugin event for editing/deleting product category
Post by: GJC Web Design on July 27, 2020, 14:08:19 PM
sadly no  .. there is no trigger

I have used a system plugin and filter by

$data = vRequest::getRequest();

if($data['option'] == 'com_virtuemart' && $data['view'] == 'category' && $data['task'] == 'apply'){

}

but difficult to get the data of the cat change

or a core hack in administrator\components\com_virtuemart\models\category.php - the public function store(&$data) ~ line 573 add after the line:


/**************GJC CORE HACK ********************/
VmConfig::importVMPlugins('vmcustom');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('plgVmAfterStoreCategory',array(&$data));
/*************GJC CORE HACK ********************/

Maybe Max would consider adding?
Title: Re: Plugin event for editing/deleting product category
Post by: pinochico on July 27, 2020, 17:06:30 PM
QuoteMaybe Max would consider adding?

Maybe, we are waiting 7 years :)
Title: Re: Plugin event for editing/deleting product category
Post by: Rsn on July 27, 2020, 18:42:48 PM
I understood you. Thank!