Added is_paying_customer() to easily check if a user is a WC customer:
Usage: ` $customer = new WC_Customer(); $out = 'Paying customer ? '; if( $customer->is_paying_customer( 10 ) ) { $out .= "yes"; } else { $out .= "no"; } echo $out; `
This commit is contained in:
parent
ca8e0380e5
commit
14267660da
|
@ -189,6 +189,22 @@ class WC_Customer {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the user a paying customer?
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function is_paying_customer( $user_id ) {
|
||||
|
||||
$paying_customer = get_user_meta( $user_id, 'paying_customer', true );
|
||||
if( $paying_customer != '' && absint( $paying_customer ) > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is customer VAT exempt?
|
||||
|
|
Loading…
Reference in New Issue