# Change the "Have a Coupon?" Prompt

> Rewrites the coupon prompt shown at the top of the classic checkout with your own wording.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, coupons, checkout, text
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-coupon-prompt-text/

## Code

```php
add_filter( 'woocommerce_checkout_coupon_message', function () {
    $intro = 'Got a discount code?';   // Text before the link.
    $link  = 'Enter it here';          // Link text.

    return esc_html( $intro ) . ' <a href="#" role="button" aria-label="' . esc_attr( $link ) . '" class="showcoupon">' . esc_html( $link ) . '</a>';
} );
```

## Notes

Keep the class="showcoupon" link so the coupon form still opens when clicked.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Change the "Have a Coupon?" Prompt" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
