WordPress at Your Fingertips
function is not described

WC_Coupon::add_coupon_message() public WC 1.0

Converts one of the WC_Coupon message/error codes to a message string and. displays the message/error.

{} It's a method of the class: WC_Coupon{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Coupon = new WC_Coupon();
$WC_Coupon->add_coupon_message( $msg_code );
$msg_code(int) (required)
Message/error code.

Code of WC_Coupon::add_coupon_message() WC 5.6.0

public function add_coupon_message( $msg_code ) {
	$msg = $msg_code < 200 ? $this->get_coupon_error( $msg_code ) : $this->get_coupon_message( $msg_code );

	if ( ! $msg ) {
		return;
	}

	if ( $msg_code < 200 ) {
		wc_add_notice( $msg, 'error' );
	} else {
		wc_add_notice( $msg );
	}
}