Merge pull request #4507 from thenbrent/cart-coupon-filters

Cart coupon filters
This commit is contained in:
Mike Jolley 2014-01-14 09:14:34 -08:00
commit a53393e534
1 changed files with 10 additions and 3 deletions

View File

@ -186,13 +186,20 @@ 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' );
echo implode( ', ', $value ) . ' <a href="' . add_query_arg( 'remove_coupon', $coupon->code, WC()->cart->get_cart_url() ) . '" class="woocommerce-remove-coupon">' . __( '[Remove]', 'woocommerce' ) . '</a>';
$value = implode( ', ', $value ) . ' <a href="' . add_query_arg( 'remove_coupon', $coupon->code, WC()->cart->get_cart_url() ) . '" class="woocommerce-remove-coupon">' . __( '[Remove]', 'woocommerce' ) . '</a>';
echo apply_filters( 'woocommerce_cart_totals_coupon_html', $value, $coupon );
}
/**