shopp_customer_exists()

find out if the customer exists

shopp_customer_exists ( $customer, $key )

@param int $customer (required) customer id, WordPress user associated customer, or email address associated with customer.
@param string $key (optional default:customer) customer for lookup by customer id, wpuser to lookup by WordPress user, or email to lookup by email address
@return bool true if the customer exists, else false

Description

find out if the customer exists

Example

Lookup if the customer exists customer by WordPress account. Only a valid option for WordPress integrated Shopp accounts.

// Get User using get_user_by() WordPress function
$User = get_user_by('login', 'myusername');

if ( shopp_customer_exists($User->ID, 'wpuser') ) {
// do stuff
}

Lookup if the customer exists by email address associated with a Shopp account.

if ( shopp_customer_exists('name@example.com', 'email') ){
// do stuff
}

Lookup if the customer exists by the customer id

if ( shopp_customer_exists(10) ) {
// do stuff
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar