Log In new user account for anonymous after checkout

Is it possible to log in a newly created user after they checkout and an account is created with their email address? The summary shows links that the user can click on if they are logged in, but they aren't accessible to an anonymous user.

Posted: Jun 13, 2012


Simon Georges on July 9, 2012


I've published a sandbox that adds a "immediate login" rules to new account creation so the user ends up logged in. Let me know if it doesn't work for you.

domineaux on July 9, 2012

I got the git file. I forgot to init my local folder.

I notice you mention needing a rule for immediate login.
Maybe you could do a walk through for building the rule as you have it working.

Also, I think a password should be created ASAP when customer creates account.
Email should be used as login UID, entering email twice is not a bad idea either. It will eliminate errors for users.
Email for UID will usually eliminate any possible dups or nicknames that people don't keep up with on sites they don't use often.
All the back and forth to email annoys people.

Verfication of email is critical for sure, but I'm not sure of a best way to verify without customer responding to email clickon or something along those lines.

Simon Georges on July 10, 2012

Unfortunately, the Rules action uses some Drupal core code, so I had to programmatically create the action. That said, once the action is created, you just could manually add it through the interface to the appropriate existing Commerce rule. I try to do it automatically to limit the actions needed by the module user to have it working, but it's totally do-able.