Hi,
i'm looking for a solution to register users in the frontend. For the username i would use a number with 6 digits starting with 300000.
I have set up a field called customer_number. It is possible to give the field a number and then count up.
300001 user1
300002 user2
At the moment my code looks like this:
if($input->post->create_user_submit) {
//instantiate variables taking in the form data
$email = $sanitizer->email($input->post->user_email);
if (in_array($input->post->email, $email)) {
echo "<h5 class='error'>E-Mail is already in use.</h5>";
} else {
//create user details
$user = new User();
$user->of(false);
$user->name = "Paul";
$user->pass = "max123";
$user->email = $email;
$user->addRole("anzeigen-anbieter");
$user->save();
$user->of(true);
}
}