You are here

function uc_coupon_token_info in Ubercart Discount Coupons 7.3

Same name and namespace in other branches
  1. 7.2 uc_coupon.tokens.inc \uc_coupon_token_info()

Implements hook_token_info().

File

./uc_coupon.tokens.inc, line 10
Token support for uc_coupon.

Code

function uc_coupon_token_info() {
  $types = array(
    'uc_coupon' => array(
      'name' => t('Coupon'),
      'description' => t('Tokens related to Ubercart discount coupons.'),
      'needs-data' => 'uc_coupon',
    ),
  );
  $tokens = array(
    'uc_coupon' => array(
      'name' => array(
        'name' => t('Name'),
        'description' => t('The name of the coupon.'),
      ),
      'code' => array(
        'name' => t('Code'),
        'description' => t('The coupon code. For bulk coupons this will be the actual code applied, or the code
        	prefix if the coupon has not yet been applied.'),
      ),
      'codes' => array(
        'name' => t('All Codes'),
        'description' => t('The coupon codes.  For bulk coupons, this will be a comma separated list of codes.'),
      ),
      'value' => array(
        'name' => t('Value'),
        'description' => t('The value of the coupon.  If the coupon has already been applied to an order, this will be
        	the actual currency value of the coupon.  Otherwise, it will be the nominal discount.'),
      ),
      'credit' => array(
        'name' => t('Remaining credit'),
        'description' => t('For store credit/gift certificate type coupons which have been applied to an order, the unused credit remaining.'),
      ),
    ),
    'uc_order' => array(
      'coupon-code' => array(
        'name' => t('Coupon Code'),
        'description' => t('The coupon code used in the order.'),
      ),
    ),
  );
  return array(
    'types' => $types,
    'tokens' => $tokens,
  );
}