WC_Coupon::get_coupon_message()
Map one of the WC_Coupon message codes to a message string.
Method of the class: WC_Coupon{}
Hooks from the method
Return
String
. Message/error string.
Usage
$WC_Coupon = new WC_Coupon(); $WC_Coupon->get_coupon_message( $msg_code );
- $msg_code(int) (required)
- Message code.
WC_Coupon::get_coupon_message() WC Coupon::get coupon message code 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 ); }