function uc_product_token_info in Ubercart 7.3
Same name and namespace in other branches
- 8.4 uc_product/uc_product.tokens.inc \uc_product_token_info()
Implements hook_token_info().
File
- uc_product/
uc_product.tokens.inc, line 11 - Token hooks for the uc_product module.
Code
function uc_product_token_info() {
$node['product'] = array(
'name' => t('Product'),
'description' => t('Ubercart product data of the node.'),
'type' => 'uc_product',
);
$types['uc_product'] = array(
'name' => t('Product'),
'description' => t('Tokens for Ubercart products.'),
'needs-data' => 'node',
);
$product['model'] = array(
'name' => t('SKU / Model'),
'description' => t("The product's SKU or model number."),
);
$product['list-price'] = array(
'name' => t('List price'),
'description' => t("The product's list price."),
'type' => 'uc_price',
);
$product['cost'] = array(
'name' => t('Cost'),
'description' => t("The product's cost."),
'type' => 'uc_price',
);
$product['sell-price'] = array(
'name' => t('Sell price'),
'description' => t("The product's sell price."),
'type' => 'uc_price',
);
$product['weight'] = array(
'name' => t('Weight'),
'description' => t("The product's weight."),
'type' => 'uc_weight',
);
$product['length'] = array(
'name' => t('Length'),
'description' => t("The product's length."),
'type' => 'uc_dimension',
);
$product['width'] = array(
'name' => t('Width'),
'description' => t("The product's width."),
'type' => 'uc_dimension',
);
$product['height'] = array(
'name' => t('Height'),
'description' => t("The product's height."),
'type' => 'uc_dimension',
);
$types['uc_price'] = array(
'name' => t('Price'),
'description' => 'Tokens for price formats.',
'needs-data' => 'uc_price',
);
$price['formatted'] = array(
'name' => t('Formatted'),
'description' => t('A formatted price.'),
);
$price['raw'] = array(
'name' => t('Raw value'),
'description' => t('A decimal price.'),
);
$types['uc_weight'] = array(
'name' => t('Weight'),
'description' => 'Tokens for weight formats.',
'needs-data' => 'uc_weight',
);
$weight['formatted'] = array(
'name' => t('Formatted'),
'description' => t('A formatted weight.'),
);
$weight['raw'] = array(
'name' => t('Raw value'),
'description' => t('A decimal weight.'),
);
$weight['units'] = array(
'name' => t('Units'),
'description' => t('The unit of measurement.'),
);
$types['uc_dimension'] = array(
'name' => t('Dimension'),
'description' => 'Tokens for length, width, and height.',
'needs-data' => 'uc_dimension',
);
$dimension['formatted'] = array(
'name' => t('Formatted'),
'description' => t('A formatted dimension.'),
);
$dimension['raw'] = array(
'name' => t('Raw value'),
'description' => t('A decimal dimension.'),
);
$dimension['units'] = array(
'name' => t('Units'),
'description' => t('The unit of measurement.'),
);
return array(
'types' => $types,
'tokens' => array(
'node' => $node,
'uc_product' => $product,
'uc_price' => $price,
'uc_weight' => $weight,
'uc_dimension' => $dimension,
),
);
}