WC_Brands_Coupons::brand_exclusion_error
Display a custom error message when a cart discount coupon does not validate because an excluded brand was found in the cart.
Method of the class: WC_Brands_Coupons{}
No Hooks.
Returns
String.
Usage
$WC_Brands_Coupons = new WC_Brands_Coupons(); $WC_Brands_Coupons->brand_exclusion_error( $err, $err_code );
- $err(string) (required)
- The error message.
- $err_code(string) (required)
- The error code.
WC_Brands_Coupons::brand_exclusion_error() WC Brands Coupons::brand exclusion error code WC 10.5.0
public function brand_exclusion_error( $err, $err_code ) {
if ( self::E_WC_COUPON_EXCLUDED_BRANDS !== $err_code ) {
return $err;
}
return __( 'Sorry, this coupon is not applicable to the brands of selected products.', 'woocommerce' );
}