You are here

function uc_discounts_rules_condition_info in Ubercart Discounts (Alternative) 7.2

Implements hook_rules_condition_info().

File

uc_discounts/uc_discounts.rules.inc, line 11
Rules integration for uc_discounts module.

Code

function uc_discounts_rules_condition_info() {
  $conditions = array();
  $conditions['uc_discounts_condition_total_after_discounts'] = array(
    'label' => t('Check the order total after discounts have been applied'),
    'module' => 'uc_discounts',
    'group' => t('Order'),
    'parameter' => array(
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
      ),
      'order_total_value' => array(
        'type' => 'integer',
        'label' => t('Order total value after discount'),
      ),
      'operator_comparison' => array(
        'type' => 'text',
        'label' => t('Operator'),
        'options list' => 'uc_order_condition_value_operator_options',
      ),
    ),
  );
  $conditions['uc_discounts_condition_discount_applied_condition'] = array(
    'label' => t('Check if a discount has been applied to the order'),
    'module' => 'uc_discounts',
    'group' => t('Order'),
    'parameter' => array(
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
      ),
      'discount_id' => array(
        'type' => 'text',
        'label' => t('Discount id'),
        'options list' => 'uc_discounts_discount_id_options',
      ),
    ),
  );
  return $conditions;
}