function uc_order_rules_condition_info in Ubercart 7.3
Implements hook_rules_condition_info().
File
- uc_order/
uc_order.rules.inc, line 81 - Hooks and functions for uc_order Rules integration.
Code
function uc_order_rules_condition_info() {
$conditions['uc_order_condition_order_state'] = array(
'label' => t("Check an order's state"),
'group' => t('Order'),
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'order_state' => array(
'type' => 'text',
'label' => t('Order state'),
'options list' => 'uc_order_condition_order_state_options',
'restriction' => 'input',
),
),
);
$conditions['uc_order_condition_delivery_country'] = array(
'label' => t("Check an order's shipping country"),
'group' => t('Order'),
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'countries' => array(
'type' => 'list<integer>',
'label' => t('Countries'),
'options list' => 'uc_country_option_list',
'restriction' => 'input',
),
),
);
$conditions['uc_order_condition_billing_country'] = array(
'label' => t("Check an order's billing country"),
'group' => t('Order'),
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'countries' => array(
'type' => 'list<integer>',
'label' => t('Countries'),
'options list' => 'uc_country_option_list',
'restriction' => 'input',
),
),
);
$conditions['uc_order_condition_has_products'] = array(
'label' => t("Check an order's products"),
'group' => t('Order: Product'),
'base' => 'uc_order_condition_has_products',
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'products' => array(
'type' => 'list<text>',
'label' => t('Products'),
'options list' => 'uc_order_condition_has_products_options',
'restriction' => 'input',
),
'required' => array(
'type' => 'boolean',
'label' => t('Require all selected products'),
'description' => t('Select to require that order must contain all selected products. Otherwise, order must contain at least one of the selected products.'),
),
'forbidden' => array(
'type' => 'boolean',
'label' => t('Forbid other products'),
),
),
);
$conditions['uc_order_condition_count_products'] = array(
'label' => t("Check an order's number of products"),
'group' => t('Order: Product'),
'base' => 'uc_order_condition_count_products',
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'products' => array(
'type' => 'list<integer>',
'label' => t('Products'),
'options list' => 'uc_order_condition_products_options',
'restriction' => 'input',
),
'product_count_value' => array(
'type' => 'integer',
'label' => t('Product count value'),
),
'product_count_comparison' => array(
'type' => 'text',
'label' => t('Operator'),
'options list' => 'uc_order_condition_value_operator_options',
),
),
);
$conditions['uc_order_condition_products_weight'] = array(
'label' => t("Check an order's total weight"),
'group' => t('Order: Product'),
'help' => t('Compare the weight of all of the products, or the weight of just one type in the order.'),
'base' => 'uc_order_condition_products_weight',
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'products' => array(
'type' => 'list<integer>',
'label' => t('Products'),
'options list' => 'uc_order_condition_products_options',
'restriction' => 'input',
),
'weight_units' => array(
'type' => 'text',
'label' => t('Unit of measurement'),
'options list' => 'uc_order_condition_weight_units_options',
),
'product_weight_value' => array(
'type' => 'decimal',
'label' => t('Product weight value'),
),
'product_weight_comparison' => array(
'type' => 'text',
'label' => t('Operator'),
'options list' => 'uc_order_condition_value_operator_options',
),
),
);
$conditions['uc_order_condition_is_shippable'] = array(
'label' => t('Check if an order can be shipped'),
'group' => t('Order'),
'base' => 'uc_order_condition_is_shippable',
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
),
);
$conditions['uc_order_condition_has_product_class'] = array(
'label' => t("Check an order's product classes"),
'group' => t('Order: Product'),
'base' => 'uc_order_condition_has_product_class',
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'product_classes' => array(
'type' => 'list<text>',
'label' => t('Product Classes'),
'options list' => 'uc_order_condition_has_product_class_classes_options',
'restriction' => 'input',
),
'required' => array(
'type' => 'boolean',
'label' => t('Require all selected product classes'),
'description' => t('Select to require that order must contain all selected product classes. Otherwise, order must contain at least one of the selected product classes.'),
),
'forbidden' => array(
'type' => 'boolean',
'label' => t('Forbid other product classes'),
),
),
);
$conditions['uc_order_condition_total'] = array(
'label' => t("Check an order's total"),
'group' => t('Order'),
'base' => 'uc_order_condition_total',
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'op' => array(
'type' => 'text',
'label' => t('Operator'),
'description' => t('The comparison operator.'),
'default value' => '==',
'options list' => 'uc_order_condition_value_operator_options',
'restriction' => 'input',
),
'value' => array(
'type' => 'decimal',
'label' => t('Data value'),
'description' => t('The value to compare the data with.'),
),
),
);
$conditions['uc_order_condition_subtotal'] = array(
'label' => t("Check an order's subtotal"),
'group' => t('Order'),
'base' => 'uc_order_condition_subtotal',
'parameter' => array(
'order' => array(
'type' => 'uc_order',
'label' => t('Order'),
),
'op' => array(
'type' => 'text',
'label' => t('Operator'),
'description' => t('The comparison operator.'),
'default value' => '==',
'options list' => 'uc_order_condition_value_operator_options',
'restriction' => 'input',
),
'value' => array(
'type' => 'decimal',
'label' => t('Data value'),
'description' => t('The value to compare the data with.'),
),
),
);
return $conditions;
}