You are here

function commerce_coupon_rules_condition_info in Commerce Coupon 7.2

Implements hook_rules_condition_info().

File

./commerce_coupon.rules.inc, line 41
Rules definitions for Commerce Coupon.

Code

function commerce_coupon_rules_condition_info() {
  $conditions['commerce_coupon_discount_coupon_codes_exist_on_order'] = array(
    'label' => t('Coupon code for a particular discount has been added to an order'),
    'group' => t('Commerce Coupon'),
    'parameter' => array(
      'commerce_order' => array(
        'type' => 'commerce_order',
        'wrapped' => TRUE,
        'label' => t('Order'),
      ),
      'commerce_discount' => array(
        'label' => t('Commerce Discount'),
        'type' => 'token',
        'options list' => 'commerce_discount_entity_list',
      ),
    ),
  );
  $conditions['commerce_coupon_evaluate_coupon_inline_conditions_rule'] = array(
    'label' => t('Coupon inline conditions pass'),
    'group' => t('Commerce Coupon'),
    'parameter' => array(
      'commerce_coupon' => array(
        'type' => 'commerce_coupon',
        'label' => t('Coupon'),
        'wrapped' => TRUE,
      ),
      'continuous_only' => array(
        'type' => 'boolean',
        'label' => t('Evaluate only continuous coupon conditions'),
        'optional' => TRUE,
      ),
    ),
  );
  $conditions['commerce_coupon_current_user_may_redeem'] = array(
    'label' => t('Current user may redeem coupon'),
    'group' => t('Commerce Coupon'),
    'parameter' => array(
      'commerce_coupon' => array(
        'type' => 'commerce_coupon',
        'label' => t('Coupon'),
        'wrapped' => TRUE,
      ),
      'commerce_order' => array(
        'type' => 'commerce_order',
        'label' => t('Order'),
        'wrapped' => TRUE,
      ),
    ),
  );
  return $conditions;
}