WC_Coupon::get_coupon_message()publicWC 1.0

Map one of the WC_Coupon message codes to a message string.

Метод класса: WC_Coupon{}

Хуки из метода

Возвращает

Строку. Message/error string.

Использование

$WC_Coupon = new WC_Coupon();
$WC_Coupon->get_coupon_message( $msg_code );
$msg_code(int) (обязательный)
Message code.

Код WC_Coupon::get_coupon_message() WC 8.7.0

public function get_coupon_message( $msg_code ) {
	switch ( $msg_code ) {
		case self::WC_COUPON_SUCCESS:
			$msg = __( 'Coupon code applied successfully.', 'woocommerce' );
			break;
		case self::WC_COUPON_REMOVED:
			$msg = __( 'Coupon code removed successfully.', 'woocommerce' );
			break;
		default:
			$msg = '';
			break;
	}
	return apply_filters( 'woocommerce_coupon_message', $msg, $msg_code, $this );
}