If coupon contains discount as well as free shipping add free shipping in brackets behind value

This commit is contained in:
Gerhard Potgieter 2018-06-04 08:58:47 +02:00
parent c68b8faa99
commit dce5bc2f0b
1 changed files with 5 additions and 1 deletions

View File

@ -281,7 +281,11 @@ function wc_cart_totals_coupon_html( $coupon ) {
$discount_amount_html = '-' . wc_price( $amount );
if ( $coupon->get_free_shipping() ) {
$discount_amount_html = __( 'Free shipping coupon', 'woocommerce' );
if ( empty( $amount ) ) {
$discount_amount_html = __( 'Free shipping coupon', 'woocommerce' );
} else {
$discount_amount_html .= __( ' (with free shipping)', 'woocommerce' );
}
}
$discount_amount_html = apply_filters( 'woocommerce_coupon_discount_amount_html', $discount_amount_html, $coupon );