Site icon Hip-Hop Website Design and Development

Permit customers to register on multisite by means of WooCommerce utilizing the identical electronic mail handle

I am engaged on establishing a multisite setting, and have run into the potential of a consumer making an attempt to register on the sub-site with the identical electronic mail handle they’ve used on the principle website. I’ve discovered some code right here which removes the duplicate electronic mail handle error and accomplishes this job.

Right here is the related code from the reply linked above:

add_filter('wpmu_validate_user_signup', 'skip_email_exist');
perform skip_email_exist($end result){
    if(isset($end result['errors']->errors['user_email']) && ($key = array_search(__('Sorry, that electronic mail handle is already used!'), $end result['errors']->errors['user_email'])) !== false) {
        unset($end result['errors']->errors['user_email'][$key]);
        if (empty($end result['errors']->errors['user_email'])) unset($end result['errors']->errors['user_email']);
    }
    outline( 'WP_IMPORTING', 'SKIP_EMAIL_EXIST' );
    return $end result;
}

The distinction in my case, is that we’re solely permitting customers to register by means of a WooCommerce buy on the sub-site and, evidently, WooCommerce does not use the identical hooks to validate the e-mail handle.

Is there an motion I can hook into in order that I can carry out the identical performance by means of WooCommerce?