You are here

function commerce_gc_commerce_coupon_condition_component_alter in Commerce GC 7

File

./commerce_gc.module, line 1211
Provides Giftcard coupon bundle, Giftcard Transaction entity and basic user interface elements.

Code

function commerce_gc_commerce_coupon_condition_component_alter($rule, $coupon_type) {
  if ($coupon_type == 'giftcard_coupon') {

    // Add a balance check condition to the coupon rules.
    $rule
      ->condition('commerce_gc_giftcard_minimum_balance', array(
      'commerce_coupon:select' => 'commerce_coupon',
    ));
  }
}