Add woocommerce_coupon_discount_amount_html filter

This commit is contained in:
Brent Shepherd 2014-01-13 16:53:16 -08:00
parent 69694e7a13
commit 66b7d4ee14
1 changed files with 7 additions and 2 deletions

View File

@ -186,8 +186,13 @@ function wc_cart_totals_coupon_html( $coupon ) {
$value = array();
if ( ! empty( WC()->cart->coupon_discount_amounts[ $coupon->code ] ) )
$value[] = '-' . wc_price( WC()->cart->coupon_discount_amounts[ $coupon->code ] );
if ( ! empty( WC()->cart->coupon_discount_amounts[ $coupon->code ] ) ) {
$discount_html = '-' . wc_price( WC()->cart->coupon_discount_amounts[ $coupon->code ] );
} else {
$discount_html = '';
}
$value[] = apply_filters( 'woocommerce_coupon_discount_amount_html', $discount_html, $coupon );
if ( $coupon->enable_free_shipping() )
$value[] = __( 'Free shipping coupon', 'woocommerce' );