You are here

function commerce_registration_rules_condition_info in Commerce Registration 7.3

Same name and namespace in other branches
  1. 7 commerce_registration.rules.inc \commerce_registration_rules_condition_info()
  2. 7.2 commerce_registration.rules.inc \commerce_registration_rules_condition_info()

Implements hook_rules_condition_info().

File

./commerce_registration.rules.inc, line 10
Commerce Registration rules file.

Code

function commerce_registration_rules_condition_info() {
  $conditions = array();
  $conditions['commerce_registration_line_item_is_registration'] = array(
    'label' => t('Line item is for a registration enabled product'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Line item'),
        'description' => t('Does this line item have a register enabled product or not.'),
      ),
    ),
  );
  $conditions['commerce_registration_line_item_registration_allowed'] = array(
    'label' => t('Line item product has registration available'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Line item'),
        'description' => t('Line item whose product is being checked for registration availability.'),
      ),
    ),
  );
  $conditions['commerce_registration_registration_count_comparison'] = array(
    'label' => t('Registration count comparison'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Line Item'),
        'description' => t('Line item containing the registrations to count.'),
      ),
      'operator' => array(
        'type' => 'text',
        'label' => t('Operator'),
        'options list' => 'commerce_registration_comparison_operators',
      ),
      'amount' => array(
        'type' => 'integer',
        'label' => t('Amount'),
      ),
    ),
  );
  $conditions['commerce_registration_order_registration_count_comparison'] = array(
    'label' => t('Order total registration count comparison'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_order' => array(
        'type' => 'commerce_order',
        'label' => t('Order'),
        'description' => t('The order of which to count the total number of registrations.'),
      ),
      'operator' => array(
        'type' => 'text',
        'label' => t('Operator'),
        'options list' => 'commerce_registration_comparison_operators',
      ),
      'amount' => array(
        'type' => 'integer',
        'label' => t('Amount'),
      ),
    ),
  );
  $conditions['commerce_registration_registration_slot_comparison'] = array(
    'label' => t('Registration slot comparison'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'registration' => array(
        'type' => 'registration',
        'label' => t('Registration'),
        'description' => t('Registration to check the total slots used'),
      ),
      'operator' => array(
        'type' => 'text',
        'label' => t('Operator'),
        'options list' => 'commerce_registration_comparison_operators',
      ),
      'amount' => array(
        'type' => 'integer',
        'label' => t('Amount'),
      ),
    ),
  );
  return $conditions;
}