plugin events

  • Francesco Reitano
  • Francesco Reitano's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 1 week ago #109608 by Francesco Reitano
Francesco Reitano created the topic: plugin events
Hi, I'm studying your code, I found that you entered only two events. But, is it possible add other events (i can change your code, but I'd rather not have problems with updates), for examples:
to add product:
file components\com_eshop\helpers\cart.php function add()
JPluginHelper::importPlugin('eshop');
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onAddProduct', array($key, $quantity));


Other question: you trigger event just from eshop folder, os it possible add other like system?
For example:
JPluginHelper::importPlugin('eshop');
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onAfterStoreOrder', array($orderRow));

to
JPluginHelper::importPlugin('eshop');
JPluginHelper::importPlugin('system');
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onAfterStoreOrder', array($orderRow));

thanks
:)

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Giang Dinh Truong's Avatar
  • Offline
  • Administrator
  • Administrator
More
2 months 3 days ago #109997 by Giang Dinh Truong
Giang Dinh Truong replied the topic: plugin events
Hello Francesco,

Thank you for suggesting these. I think they are useful. I will check more and add these into the next versions of EShop.

Sincerely, Giang

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong