Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Auto create a user account when admin creates new order for new customer

Hey all,

So I think the title kind of explains it all. What I'm trying to do is auto-generate a user account for a new customer when an admin creates a new order for that customer if the system detects that there is no existing user account. I understand that an admin could create a new user and then create a new order separately, but this is time consuming and inefficient (especially if the customer is on the phone while the admin is taking the order).

I have several initial thoughts on this:

  • There is currently no "account information" (i.e. email) field when an admin creates an order. Maybe this could be a user reference field that creates a new account if the field is left empty upon saving the new order
  • I'm not really sure what the rules structure would be like for this functionality. I know I would have to do a data comparison to check the customer's user id to see if it's non-existant, but how do I do that if an admin is already logged in and creating the order? This could be related to the prior observation

I think this is a fairly common use scenario (any company that takes phone orders). Any thoughts or strategies would be much appreciated!

Cheers.

Asked by: Abenezer
on January 28, 2013

Comments

Anyone have any thoughts on this? Just a bump.

- Abenezer on February 7, 2013

1 Answer

Vote up!
1
Vote down!

Abenezer,

Here's a working rule. It requires that you are creating an order and the "mail" field of the order not be empty. This would require the people taking the orders to add the customer's email address before saving the Order. But if they do, a user account is created and a "welcome" email is sent with a password reset link.

http://pastebin.com/rEAVAzWN

You would also need a rule that assigns orders to existing users based on email address.

Josh

Josh Miller
Answer by: Josh Miller
Posted: Feb 8, 2013

Comments

Josh,

The Rule you made to create a user when an order is filled ( http://pastebin.com/rEAVAzWN ) It is something I had been looking for a long time, so thanks a lot.However when I import it in Rules I get the following error: 'Integrity check for the imported configuration failed. Error message: The data type of the configured argument does not match the parameter's list requirement..'
I have Rules 7.x-2.7 on Drupal 7.27.
Would you have any suggestion what causes this? I'd be most grateful.

Theo Richel

- Theo Richel on May 10, 2014