You are here

function commerce_gc_commerce_coupon_value_display_alter in Commerce GC 7

File

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

Code

function commerce_gc_commerce_coupon_value_display_alter(&$text, $coupon, $order) {
  if ($coupon->type == 'giftcard_coupon') {
    $coupon_wrapper = entity_metadata_wrapper('commerce_coupon', $coupon);
    $name = $coupon_wrapper->commerce_gc_name
      ->value();
    $text = $name ? $name : t('Giftcard');
  }
}