Пример #1
0
 public static function onBeforeClientSignUp(Box_Event $event)
 {
     $data = $event->getSubject();
     if (!isset($data['country']) || empty($data['country'])) {
         throw new Box_Exception('Please select your country');
     }
 }
Пример #2
0
 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
     }
 }
Пример #3
0
 /**
  * Activate services imediately after payment is received.
  * Do not to wait while cron activates services
  * 
  * @param Box_Event $event 
  */
 public static function onAfterAdminInvoicePaymentReceived(Box_Event $event)
 {
     $invoice = $event->getSubject();
     $repo = Box_Db::getTable('Model_Invoice');
     try {
         $repo->activate($invoice);
     } catch (Exception $e) {
         error_log($e->getMessage());
     }
 }
Пример #4
0
 public static function onBeforeClientSignUp(Box_Event $event)
 {
     $data = $event->getSubject();
     if (!isset($data['country']) || empty($data['country'])) {
         throw new Box_Exception('Please select your country');
     }
     if (!isset($data['city']) || empty($data['city'])) {
         throw new Box_Exception('Please enter your city');
     }
     if (!isset($data['phone_cc']) || empty($data['phone_cc'])) {
         throw new Box_Exception('Please enter your Phone Country Code');
     }
     if (!isset($data['phone']) || empty($data['phone'])) {
         throw new Box_Exception('Please enter your phone');
     }
     if (!isset($data['address_1']) || empty($data['address_1'])) {
         throw new Box_Exception('Please enter your address');
     }
     if (!isset($data['postcode']) || empty($data['postcode'])) {
         throw new Box_Exception('Please enter your Zip/Postal Code');
     }
 }