You are here

function uc_coupon_workflow_rules_event_info in Ubercart Discount Coupons 7.3

Same name and namespace in other branches
  1. 7.2 uc_coupon_workflow/uc_coupon_workflow.rules.inc \uc_coupon_workflow_rules_event_info()

Implements hook_rules_event_info().

File

uc_coupon_workflow/uc_coupon_workflow.rules.inc, line 15
Rules integration for uc_coupon_workflow

Code

function uc_coupon_workflow_rules_event_info() {

  // Event invoked when a valid coupon is applied.
  $events['uc_coupon_workflow_applied'] = array(
    'label' => t('A valid discount coupon is applied'),
    'group' => t('Coupon'),
    'variables' => array(
      'coupon' => array(
        'type' => 'uc_coupon',
        'label' => t('Coupon'),
      ),
    ),
  );

  // Event invoked when a valid coupon is applied.
  $events['uc_coupon_workflow_removed'] = array(
    'label' => t('A valid discount coupon is removed'),
    'group' => t('Coupon'),
    'variables' => array(
      'coupon' => array(
        'type' => 'uc_coupon',
        'label' => t('Coupon'),
      ),
    ),
  );

  // Event invoked when checking for automatic coupons.
  $events['uc_coupon_workflow_automatic'] = array(
    'label' => t('Check for automatic discounts.'),
    'group' => t('Coupon'),
    'variables' => array(
      'current_order' => array(
        'type' => 'uc_order',
        'label' => t('Current Order'),
      ),
    ),
  );

  // Event invoked when a coupon is submitted with an order.
  // !TODO This functionality would be better implemented by some sort of conditional
  // loop processing. See http://drupal.org/node/821986
  $events['uc_coupon_workflow_checkout'] = array(
    'label' => t('A customer checks out with a valid discount coupon'),
    'group' => t('Coupon'),
    'variables' => array(
      'coupon' => array(
        'type' => 'uc_coupon',
        'label' => t('Coupon'),
      ),
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
      ),
    ),
  );
  return $events;
}