What is the PHP Code for Woo Customer Type (New/Returning)

A custom function would be required. You can check for any orders placed by customer details, but I’d recommend using either customer id (best option as you can get the logged in user’s id very easily) or customer email address..

function wpse419519_is_returning_customer( $customer ) {
    
    $args = array(
        'limit' => -1, //Returns all the orders
    );
    
    if ( is_email($customer) ) { //If you want to check with email address
        $args['customer'] = $customer;
    } else {
        $args['customer_id'] = $customer;
    }
    
    $orders = wc_get_orders( $args );
    
    if ( !empty($orders) ) {
        return true;
    }
    
    return false;
}

You can now call wpse419519_is_returning_customer() anywhere after the user is authenticated to check if it is a returning customer. For example:

$is_returning = wpse419519_is_returning_customer(get_current_user_id());

if ($is_returning) {
    //Returning customer
} else {
    //New customer
}

techhipbettruvabetnorabahisbahis forumueduseduedueduedueduedueduseduedu