add filter to toggle between coupon's discount amount and free shipping text

This commit is contained in:
Caleb Stauffer 2018-05-31 20:44:49 -04:00
parent 07bad6975f
commit 6fc7a2d7cc
1 changed files with 1 additions and 1 deletions

View File

@ -280,7 +280,7 @@ function wc_cart_totals_coupon_html( $coupon ) {
$amount = WC()->cart->get_coupon_discount_amount( $coupon->get_code(), WC()->cart->display_cart_ex_tax );
$discount_amount_html = '-' . wc_price( $amount );
if ( $coupon->get_free_shipping() ) {
if ( $coupon->get_free_shipping() && ! apply_filters( 'woocommerce_coupon_show_discount_amount', ! empty( $amount ), $coupon ) ) {
$discount_amount_html = __( 'Free shipping coupon', 'woocommerce' );
}