Skip to content

Instantly share code, notes, and snippets.

@boxbilling
Created February 14, 2012 07:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxbilling/1824466 to your computer and use it in GitHub Desktop.
Save boxbilling/1824466 to your computer and use it in GitHub Desktop.
Custom Event Hook which uses product plugin for BoxBilling
<?php
/**
* Example product plugin usage
*/
class Hook_Custom
{
public static function onAfterOrderActivate(Box_Event $event)
{
$order = $event->getSubject();
$plugin = $order->Product->plugin;
if($plugin == 'MyPlugin') {
// init plugin class
// do something with plugin on order activation action
}
}
public static function onAfterOrderRenew(Box_Event $event)
{
}
public static function onAfterOrderSuspend(Box_Event $event)
{
}
public static function onAfterOrderUnsuspend(Box_Event $event)
{
}
public static function onAfterOrderCancel(Box_Event $event)
{
}
public static function onAfterOrderUncancel(Box_Event $event)
{
}
public static function onAfterOrderDelete(Box_Event $event)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment