Wednesday, 10 April 2019
  1 Replies
  0.9K Visits
0
Votes
Undo
I am creating a simple Reservation Booking site using JEvents. I want the user to select dates from the calendar and when the event is saved I'd like to trigger a PHP script that makes API calls to a pricing site and return the results for user approval.

I've got the API and am working on the module to support it. What I need to know is does JEvents have a way to make the call to my code when an event is created?

Thank you....
Thursday, 11 April 2019 09:04
·
#210144
0
Votes
Undo
Hello,

Is this post creation or pre-creation? In essenance yes, you can create a Plugin and hook it in. See:

For pre-creation


$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin("jevents");
$res = $dispatcher->trigger( 'onBeforeSaveEvent' , array(&$array, &$rrule, $dryrun));


For post-creation:


$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin("jevents");
$res = $dispatcher->trigger( 'onAfterSaveEvent' , array(&$vevent, false));



Many thanks
Tony

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!Join the JEvents club today!

  • Page :
  • 1
There are no replies made for this post yet.