You are here

function uc_coupon_init in Ubercart Discount Coupons 7.3

Same name and namespace in other branches
  1. 6 uc_coupon.module \uc_coupon_init()
  2. 7.2 uc_coupon.module \uc_coupon_init()

Implements hook_init().

File

./uc_coupon.module, line 220
Provides discount codes and gift certificates for Ubercart.

Code

function uc_coupon_init() {
  global $conf;
  $conf['i18n_variables'][] = 'uc_coupon_pane_description';

  // Auto apply coupon from query string, if configured.
  if ($param = variable_get('uc_coupon_querystring', '')) {
    if (isset($_GET[$param]) && $_GET[$param]) {

      // We retain the querystring coupon so that it will validate if/when appropriate conditions are met.
      uc_coupon_session_add($_GET[$param], 'retain');
    }
  }
}