Skip to content

Instantly share code, notes, and snippets.

@artikus11
Created June 1, 2017 21:21
Show Gist options
  • Save artikus11/1052507383a6e9586950d86f20da6258 to your computer and use it in GitHub Desktop.
Save artikus11/1052507383a6e9586950d86f20da6258 to your computer and use it in GitHub Desktop.
Добавление величины скидки по купону
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