function uc_order_token_info in Ubercart 7.3
Same name and namespace in other branches
- 8.4 uc_order/uc_order.tokens.inc \uc_order_token_info()
Implements hook_token_info().
File
- uc_order/
uc_order.tokens.inc, line 11 - Token hooks for the uc_order module.
Code
function uc_order_token_info() {
$types = array(
'name' => t('Orders'),
'description' => t('Tokens related to Ubercart orders.'),
'needs-data' => 'uc_order',
);
$tokens = array();
$tokens['new-username'] = array(
'name' => t('New username'),
'description' => t('New username associated with an order if applicable.'),
);
$tokens['new-password'] = array(
'name' => t('New password'),
'description' => t('New password associated with an order if applicable.'),
);
$tokens['order-number'] = array(
'name' => t('Order number'),
'description' => t('The unique identifier of the order.'),
);
$tokens['url'] = array(
'name' => t('URL'),
'description' => t('The URL to the order'),
'type' => 'url',
);
$tokens['link'] = array(
'name' => t('Link'),
'description' => t('A link to the order using the order ID.'),
);
$tokens['admin-url'] = array(
'name' => t('Admin URL'),
'description' => t('The URL to the admin view page using the order ID.'),
'type' => 'url',
);
$tokens['admin-link'] = array(
'name' => t('Admin link'),
'description' => t('A link to the order admin view page using the order ID.'),
);
$tokens['subtotal'] = array(
'name' => t('Subtotal'),
'description' => t('The subtotal of products on an order.'),
);
$tokens['total'] = array(
'name' => t('Total'),
'description' => t('The order total.'),
);
$tokens['email'] = array(
'name' => t('Email'),
'description' => t('The primary e-mail address of the order.'),
);
// Duplicate [uc_order:email] as [uc_order:mail] as VBO validates tokens ending in :mail.
$tokens['mail'] = $tokens['email'];
$tokens['shipping-method'] = array(
'name' => t('Shipping method'),
'description' => t('The title of the first shipping line item.'),
);
$tokens['shipping-address'] = array(
'name' => t('Shipping address'),
'description' => t('The order shipping address.'),
);
$tokens['shipping-phone'] = array(
'name' => t('Shipping phone number'),
'description' => t('The phone number for the shipping address.'),
);
$tokens['billing-address'] = array(
'name' => t('Billing address'),
'description' => t('The order billing address.'),
);
$tokens['billing-phone'] = array(
'name' => t('Billing phone number'),
'description' => t('The phone number for the billing address.'),
);
$tokens['first-name'] = array(
'name' => t("Customer's first name"),
'description' => t('The first name associated with the order.'),
);
$tokens['last-name'] = array(
'name' => t("Customer's last name"),
'description' => t('The last name associated with the order.'),
);
$tokens['comments'] = array(
'name' => t('Comments'),
'description' => t('Comments left by the customer.'),
);
$tokens['last-comment'] = array(
'name' => t('Last comment'),
'description' => t('Last order comment left by an administrator (not counting the order admin comments).'),
);
$tokens['order-status'] = array(
'name' => t('Order status'),
'description' => t('The current order status.'),
);
$tokens['customer'] = array(
'name' => t('Customer'),
'description' => t('The user associated with the order.'),
'type' => 'user',
);
$tokens['created'] = array(
'name' => t('Created'),
'description' => t('The date and time when the order was created.'),
'type' => 'date',
);
$tokens['modified'] = array(
'name' => t('Modified'),
'description' => t('The date and time when the order was last modified.'),
'type' => 'date',
);
$tokens['products'] = array(
'name' => t('Products'),
'description' => t('A list of products in the order.'),
);
return array(
'types' => array(
'uc_order' => $types,
),
'tokens' => array(
'uc_order' => $tokens,
),
);
}