You are here

function hook_commerce_coupon_discount_value_display_alter in Commerce Coupon 7.2

Alter the display of the description that of the discount that a coupon confers, when that coupon is being shown in the checkout area.

Parameters

string $display: The text that will be displayed for a single discount that the coupon confers. This hook fires for each discount on each coupon attached to an order.

CommerceDiscount $discount: Discount conferred by coupon

object $order: The order that the coupon is attached to

See also

commerce_coupon_handler_field_discount_value_display::render().

1 function implements hook_commerce_coupon_discount_value_display_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

commerce_coupon_commerce_coupon_discount_value_display_alter in ./commerce_coupon.module
Implements hook_commerce_coupon_discount_savings_value_alter().
1 invocation of hook_commerce_coupon_discount_value_display_alter()
commerce_coupon_handler_field_discount_value_display::render in includes/views/handlers/commerce_coupon_handler_field_discount_value_display.inc
Overrides parent::render().

File

./commerce_coupon.api.php, line 178

Code

function hook_commerce_coupon_discount_value_display_alter($display, $discount, $order) {

  // Change the discount display for coupons that confer an order discount.
  if ($discount->type == 'order_discount') {
    $display = t('Order discount');
  }
}