You are here

function commerce_price_rules_condition_info in Commerce Core 7

Implements hook_rules_condition_info().

File

modules/price/commerce_price.rules.inc, line 133
Rules integration for the Price module.

Code

function commerce_price_rules_condition_info() {
  $conditions = array();
  $conditions['commerce_price_compare_price'] = array(
    'label' => t('Price comparison'),
    'parameter' => array(
      'first_price' => array(
        'type' => 'commerce_price',
        'label' => t('First Price'),
        'description' => t('The price value that should be compared.'),
        'default mode' => 'selector',
      ),
      'operator' => array(
        'type' => 'text',
        'label' => t('Operator'),
        'description' => t('The comparison operator.'),
        'optional' => TRUE,
        'default value' => '=',
        'options list' => 'commerce_numeric_comparison_operator_options_list',
        'restriction' => 'input',
      ),
      'second_price' => array(
        'type' => 'commerce_price',
        'label' => t('Second Price'),
        'description' => t('The corresponding price value that should be compared against.'),
      ),
    ),
    'group' => t('Commerce Price'),
    'callbacks' => array(
      'execute' => 'commerce_price_rules_compare_price',
    ),
  );
  return $conditions;
}