You are here

function hook_uc_coupon_alter in Ubercart Discount Coupons 6

Same name and namespace in other branches
  1. 7.2 uc_coupon.api.php \hook_uc_coupon_alter()

hook_uc_coupon_alter().

Allow modules to alter a coupon after it is loaded.

Parameters

$coupon: The coupon object that was just laoded.

1 invocation of hook_uc_coupon_alter()
uc_coupon_load in ./uc_coupon.module
Load a coupon object.

File

./uc_coupon.api.php, line 63
Ubercart Discount Coupon module api/hooks. Version 6.x-1.x

Code

function hook_uc_coupon_alter(&$coupon) {

  // Allow certain users to get double the discount.
  if (user_access('get double discount')) {
    $coupon->value *= 2;
  }
}