You are here

function commerce_registration_rules_condition_info in Commerce Registration 7

Same name and namespace in other branches
  1. 7.3 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_order_has_registration'] = array(
    'label' => t('Line Item product is register enabled.'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_order' => array(
        'type' => 'commerce_line_item',
        'label' => t('Commerce Line Item'),
        'description' => t('The Commerce Line Item that should be checked for a register enabled product.'),
      ),
    ),
    'callbacks' => array(
      'execute' => 'commerce_registration_order_has_registration',
    ),
  );
  $conditions['commerce_registration_multiple_product_types_allowed'] = array(
    'label' => t('Order contains only specific product types.'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_order' => array(
        'type' => 'commerce_order',
        'label' => t('Commerce Order'),
        'description' => t('The Commerce Order whose line items should be checked for allowed product types.'),
      ),
      'product_types' => array(
        'type' => 'list<text>',
        'label' => t('Product Types'),
        'description' => t('The product types to allow in the cart.'),
        'options list' => 'commerce_registration_product_types',
        'restriction' => 'input',
      ),
    ),
    'callbacks' => array(
      'execute' => 'commerce_registration_order_product_types_allowed',
    ),
  );
  $conditions['commerce_registration_item_has_registration_capacity'] = array(
    'label' => t('Product is available for registration'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Commerce Line Item'),
        'description' => t('The Commerce Line Item containing the product to check if registrations are available. Checks open date, closing date, and capacity.'),
      ),
    ),
    'callbacks' => array(
      'execute' => 'commerce_registration_item_can_register',
    ),
  );
  $conditions['commerce_registration_line_item_is_waitlist'] = array(
    'label' => t('Line Item type is waitlist'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Commerce Line Item'),
        'description' => t('The Commerce Line Item to check the line item type.'),
      ),
    ),
    'callbacks' => array(
      'execute' => 'commerce_registration_line_item_is_waitlist',
    ),
  );
  $conditions['commerce_registration_line_item_is_on_waitlist'] = array(
    'label' => t('Product is already on the waitlist'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Commerce Line Item'),
        'description' => t('The Commerce Line Item to check for an existing wait list line item.'),
      ),
    ),
    'callbacks' => array(
      'execute' => 'commerce_registration_line_item_is_on_waitlist',
    ),
  );
  $conditions['commerce_registration_can_be_waitlisted'] = array(
    'label' => t('Product has a waitlist'),
    'group' => t('Commerce Registration'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Commerce Line Item'),
        'description' => t('The Commerce Line Item to check if the product can be put on a waitlist.'),
      ),
    ),
    'callbacks' => array(
      'execute' => 'commerce_registration_can_be_waitlisted',
    ),
  );
  return $conditions;
}