Menu Close

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

default

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 CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 5
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_filter( 'woocommerce_checkout_coupon_message', 'bbloomer_have_coupon_message');

function bbloomer_have_coupon_message() {
   return '<i class="fa fa-ticket" aria-hidden="true"></i> Have a coupon? <a href="#" class="showcoupon">Click here to enter your discount code</a>';
}
View Source
Posted in WooCommerce Tips