You are here

function hook_order_state in Ubercart 6.2

Registers static order states.

Order states are module-defined categories for order statuses. Each state will have a default status that is used when modules need to move orders to new state, but don't know which status to use.

Return value

An array of order state definitions. Each definition is an array with the following keys:

  • id: The machine-readable name of the order state.
  • title: The human-readable, translated name.
  • weight: The list position of the state.
  • scope: Either "specific" or "general".
3 functions implement hook_order_state()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_order_condition_check_order_state in uc_order/uc_order.ca.inc
Check the current order state.
uc_order_order_state in uc_order/uc_order.module
Implements hook_order_state().
uc_payment_order_state in payment/uc_payment/uc_payment.module
Implements hook_order_state().
1 invocation of hook_order_state()
uc_order_state_list in uc_order/uc_order.module
Return a sorted list of the order states defined in the various modules.

File

docs/hooks.php, line 921
These are the hooks that are invoked by the Ubercart core.

Code

function hook_order_state() {
  $states[] = array(
    'id' => 'canceled',
    'title' => t('Canceled'),
    'weight' => -20,
    'scope' => 'specific',
  );
  $states[] = array(
    'id' => 'in_checkout',
    'title' => t('In checkout'),
    'weight' => -10,
    'scope' => 'specific',
  );
  $states[] = array(
    'id' => 'post_checkout',
    'title' => t('Post checkout'),
    'weight' => 0,
    'scope' => 'general',
  );
  $states[] = array(
    'id' => 'completed',
    'title' => t('Completed'),
    'weight' => 20,
    'scope' => 'general',
  );
  return $states;
}