function uc_coupon_purchase_print in Ubercart Discount Coupons 6
Same name and namespace in other branches
- 7.3 uc_coupon_purchase/uc_coupon_purchase.pages.inc \uc_coupon_purchase_print()
- 7.2 uc_coupon_purchase/uc_coupon_purchase.pages.inc \uc_coupon_purchase_print()
Print a purchased coupon.
1 string reference to 'uc_coupon_purchase_print'
- uc_coupon_purchase_menu in uc_coupon_purchase/
uc_coupon_purchase.module - Implementation of hook_menu().
File
- uc_coupon_purchase/
uc_coupon_purchase.pages.inc, line 71
Code
function uc_coupon_purchase_print($account, $coupon, $op = 'view', $code = NULL) {
drupal_set_title(t('Coupon #@cid', array(
'@cid' => $coupon->cid,
)));
module_load_include('inc', 'uc_coupon', 'uc_coupon.admin');
$url = 'user/' . $account->uid . '/coupons/' . $coupon->cid . '/print' . ($code ? "/{$code}" : '');
$output = '<p>' . l($coupon->bulk && !$code ? t('Print coupons') : t('Print coupon'), $url) . '</p>';
// Add the owner account object to the coupon.
$coupon->owner = $account;
// Does not return if op = 'print'
$output .= uc_coupon_print($coupon, $code, $op);
return $output;
}