You are here

function commerce_registration_tokens in Commerce Registration 7

Same name and namespace in other branches
  1. 7.3 commerce_registration.tokens.inc \commerce_registration_tokens()
  2. 7.2 commerce_registration.tokens.inc \commerce_registration_tokens()

Implements hook_tokens().

File

./commerce_registration.tokens.inc, line 19

Code

function commerce_registration_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $items = array();
  if (!isset($data['registration'])) {
    return array();
  }
  $reg = $data['registration'];
  if ($type == 'registration') {
    foreach ($tokens as $key => $token) {
      switch ($key) {
        case "commerce_order":
          $items[$token] = $reg->order_id;
          break;
      }
    }
  }
  return $items;
}