Skip to main content
Login Join
Snippet · PHP

Show Coupon Code in Uppercase in Cart & Checkout

Shared by Kamran Abdul Aziz · May 13, 2026 · @woocommerce_cart_totals_coupon_label

16 views
Back to Snippets

By default, WooCommerce displays applied coupon codes in lowercase in the cart and checkout totals. This snippet overrides that label to show the coupon code in uppercase, which looks more professional and consistent with how coupons are typically marketed. Uses mb_strtoupper() for full multibyte and UTF-8 character support, and esc_html__() with the WooCommerce text domain to keep the label translation-ready across all languages.

add_filter( 'woocommerce_cart_totals_coupon_label', 'uppercase_coupon_label_in_cart', 10, 2 );

function uppercase_coupon_label_in_cart( $label, $coupon ) {

    return esc_html__( 'Coupon:', 'woocommerce' ) . ' ' . mb_strtoupper( $coupon->get_code() );

}