uc-coupon-certificate.tpl.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Basic template for a printed coupon certificate.
  4. *
  5. * Coupon data is available in the following variables:
  6. *
  7. * $coupon - the coupon object
  8. * $code - the specific coupon code to be printed
  9. * $display_name - the name of the coupon (with "purchased by..." stripped)
  10. * $include - an array of the items for which this coupon is valid, if any
  11. * $exclude - an array of the items for which this coupon is not valid, if any
  12. * $valid_from - the formatted date the coupon is valid from, if set
  13. * $valid_until - the formatted date the coupon is valid until, if set
  14. * $not_yet_valid - TRUE if the coupon is not yet valid
  15. * $max_uses_per_user - the number of times this coupon can be used per customer
  16. *
  17. * For purchased coupons, the following is also available:
  18. *
  19. * $coupon->owner - the account object of the purchaser
  20. *
  21. * Also includes global tokens, and thus the global Ubercart store information.
  22. *
  23. * Templates for specific coupons may be created after the following patterns:
  24. * uc-coupon-certificate--[cid].tpl.php
  25. * (where [cid] is the id of the coupon for which the template should be applied)
  26. * uc-coupon-certificate--base-[cid].tpl.php
  27. * (where [cid] is the base cid for the coupon, if it was a purchased coupon)
  28. */
  29. ?>
  30. <div class="uc-coupon-certificate">
  31. <?php if (!empty($site_logo)): ?>
  32. <div class="site-logo"><?php print $site_logo; ?></div>
  33. <?php endif; ?>
  34. <?php if (!empty($store_name)): ?>
  35. <h3 class="store-name"><?php print $store_name;?></h3>
  36. <?php endif; ?>
  37. <?php if (!empty($site_url)): ?>
  38. <div class="store-url"><?php print $site_url;?></div>
  39. <?php endif; ?>
  40. <h2 id="title"><?php print $display_name; ?></h2>
  41. <h1 class="uc-coupon-code"><?php print $code; ?></h1>
  42. <p>This certificate entitles you to a discount of <?php print $value ?> at <?php print $store_name ?>.
  43. <?php if (!empty($site_url)): ?>
  44. Please visit us at <?php print $site_url; ?> and enter the code <strong><?php print $code; ?></strong> at checkout to obtain your discount.
  45. <?php endif; ?>
  46. </p>
  47. <?php if (!empty($valid_until)): ?>
  48. <p>Valid <?php if (!empty($not_yet_valid)) print "from " . $valid_from; ?> until <?php print $valid_until; ?>.</p>
  49. <?php endif; ?>
  50. <?php if (!empty($max_uses_per_user)): ?>
  51. <p><?php print format_plural($max_uses_per_user, 'Maximum one use per customer.', 'Maximum @count uses per customer.'); ?></p>
  52. <?php endif; ?>
  53. <dl>
  54. <?php if (!empty($include)): ?>
  55. <dt>May be used for any of the following:</dt>
  56. <dd><?php print implode(", ", $include); ?>.</dd>
  57. <?php endif; ?>
  58. <?php if (!empty($exclude)): ?>
  59. <dt>Not valid for any of the following:</dt>
  60. <dd><?php print implode(", ", $exclude); ?>.</dd>
  61. <?php endif; ?>
  62. </dl>
  63. </div>