function uc_order_condition_total in Ubercart 6.2
Same name and namespace in other branches
- 8.4 uc_order/uc_order.rules.inc \uc_order_condition_total()
- 7.3 uc_order/uc_order.rules.inc \uc_order_condition_total()
Check the current order balance.
See also
uc_order_condition_total_form()
2 string references to 'uc_order_condition_total'
- uc_order_ca_condition in uc_order/
uc_order.ca.inc - Implements hook_ca_condition().
- _ca_convert_conditions in ca/
ca.admin.inc - Helper function for converting Ubercart's Workflow-ng conditions.
File
- uc_order/
uc_order.ca.inc, line 426 - This file contains the Conditional Actions hooks and functions necessary to make the order related entity, conditions, events, and actions work.
Code
function uc_order_condition_total($order, $settings) {
$total = uc_order_get_total($order, TRUE);
switch ($settings['order_total_comparison']) {
case 'less':
return $total < $settings['order_total_value'];
case 'less_equal':
return $total <= $settings['order_total_value'];
case 'equal':
return $total == $settings['order_total_value'];
case 'greater_equal':
return $total >= $settings['order_total_value'];
case 'greater':
return $total > $settings['order_total_value'];
}
}