• Resolved cdtrue

    (@cdtrue)


    Hi!
    I can not for the life of me figure out how to place an order without having an e-mail. The reason for people ordering on the phone is for me elderly people without an e-mail account. I have managed to bypass it on regular orders but still get stuck with the phone orders. Please help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    if you use Pro version – visit tab “Settings”, section “New customer” and unmark “Email” field in list of required fields.

    if you use Free version – use this code to auto-generate emails ,
    but you still have to put any text in field “Email”

    add_filter( 'wpo_before_create_customer', function($data){
    $fake_email = sanitize_email( trim( $data['first_name'] ) . trim( $data['last_name'] ) . '@test.com' );
    if ( ! $fake_email AND ! empty( $data['phone'] ) ) {
    	$fake_email = sanitize_email( "Tel." . trim( $data['phone'] ) . '@test.com' );
    }
    if ( ! $fake_email ) { //use date
    	$fake_email = sanitize_email( current_time("Ymd") . '@test.com' );
    }
    $data['email'] = $fake_email;
    
    // BUT don't pass it to WordPress!
    add_filter( 'pre_user_email', function () {
    	return "";
    } );
    
    return $data;
    });
    Thread Starter cdtrue

    (@cdtrue)

    Wow! Thank you – worked like a charm!

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Phone order without e-mail’ is closed to new replies.