• I see in the pm pro helper module that it checks $pmprorh_options[“use_email_for_login”] = true;

    but on the checkout page, it doesn’t seem to use that code, it outputs from the plugin page temples, which seem to have username hard-coded.

    How do I set it so that it uses the email address as a username, so I can stop prompting for username, and just rely on their email address?

    https://www.ads-software.com/plugins/paid-memberships-pro/

Viewing 1 replies (of 1 total)
  • Hey there,

    That use_email_for_login option actually only applies to the registration form module in register helper. If you want to use the email as username, you can use this code:

    function my_init_email_as_username()
    {
      //check for level as well to make sure we're on checkout page
      if(empty($_REQUEST['level']))
        return;
    
      if(!empty($_REQUEST['bemail']))
        $_REQUEST['username'] = $_REQUEST['bemail'];
    
      if(!empty($_POST['bemail']))
        $_POST['username'] = $_POST['bemail'];
    
      if(!empty($_GET['bemail']))
        $_GET['username'] = $_GET['bemail'];
    }
    add_action('init', 'my_init_email_as_username');

    in your functions.php or customizations plugin and then hide the username field either using CSS or a custom page template.

    If you need further help, please consider becoming a PMPro member for our member support forums.

    Hope that clears things up!

    Thanks,
    Jess

Viewing 1 replies (of 1 total)
  • The topic ‘Use email for login toggle, no effect’ is closed to new replies.