Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Customize Message on coupon by URL › Reply To: Customize Message on coupon by URL

#17754
Soft79
Keymaster

You can use this PHP snippet for that:


add_filter(
  'woocommerce_coupon_message',
  function( $msg, $msg_code, $coupon ) {
    if ( $coupon->get_code() === 'MY COUPON' && $msg_code == WC_Coupon::WC_COUPON_SUCCESS ) {
      $msg = 'You coupon has been applied!';
    }
    return $msg;
  }, 10, 3 );

(Untested)