Hello,
I have the following code snippet in /woocommerce/emails/customer-new-account.php:
// Get the user ID associated with the mail
$user = get_user_by('login', $user_login );
$user_id = $user->ID;
// Check if $user_id is not empty before calling is_b2b_user()
if ($user_id) {
if (b2bking()->is_b2b_user($user_id)) {
echo "<br>B2B user.<br>";
} else {
echo "<br>Not a B2B User.<br>";
}
} else {
// Handle the case where $user_id is empty (e.g., guest customer)
echo "<br>Guest customer (not registered).<br>";
}
Unfortunately, even for Not-Yet-Approved B2B-Users, the output of b2bking()->is_b2b_user($user_id) is false, therefore "Not a B2B User.
The expected output would be true, since we still have to handle him like a b2b-user. Is there a fix or workaround for this?
Thank you!