Home » WooCommerce: Edit “Have a Coupon?” Message @ Checkout

WooCommerce: Edit “Have a Coupon?” Message @ Checkout

by Tutor Aspire

I wanted to do something different on my own checkout page, and change the default “Have a Coupon?” message. Thankfully, WooCommerce gives us a filter we can use to accomplish anything we like – such as adding a FontAwesome icon or changing the text string completely!

WooCommerce: editing "Have a Coupon?" message @ checout
WooCommerce: editing “Have a Coupon?” message @ checout

PHP Snippet: Translate “Have a Coupon?” Message @ WooCommerce Checkout

/**
 * @snippet       Edit "Have a Coupon" message @ WooCommerce Checkout
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 5
 * @donate $9     https://tutoraspire.com
 */

add_filter( 'woocommerce_checkout_coupon_message', 'tutoraspire_have_coupon_message');

function tutoraspire_have_coupon_message() {
   return ' Have a coupon? Click here to enter your discount code';
}

You may also like