Created
June 1, 2017 21:21
-
-
Save artikus11/1052507383a6e9586950d86f20da6258 to your computer and use it in GitHub Desktop.
Добавление величины скидки по купону
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_cart_totals_coupon_label', 'kld_cart_totals_coupon_html_label', 10, 3 ); | |
function kld_cart_totals_coupon_html_label( $coupon_text, $coupon ) { | |
if ( is_string( $coupon ) ) { | |
$coupon = new WC_Coupon( $coupon ); | |
} | |
$coupon_text .= ' ' . $coupon->get_amount() . '%'; | |
return $coupon_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment