You are here

function hook_commerce_coupon_condition_outcome_alter in Commerce Coupon 7.2

Alter the outcome of whether a coupon applies to an order.

Parameters

bool $outcome: The outcome of coupon condition check.

array $context: An array containing:

  • order: the order that the coupon is being applied to.
  • coupon: the coupon
  • data: an arbitrary array of contextual data. Not currently used.
1 invocation of hook_commerce_coupon_condition_outcome_alter()
commerce_coupon_evaluate_conditions in ./commerce_coupon.module
Run the condition component for a coupon.

File

./commerce_coupon.api.php, line 137

Code

function hook_commerce_coupon_condition_outcome_alter(&$outcome, $context) {
  if ($context['coupon']->type == 'mytype') {
    $outcome = FALSE;
  }
}