The following default Rules should cover the needs of checkout and do away with most of the checkout settings.

  1. If an anonymous user checks out with an existing e-mail address... change the order and customer profile(s) to point to the uid. Associate this uid with the referenced customer profiles.
  2. If an anonymous user checks out with a non-existent e-mail address... create a new user with status settings and notification e-mails matching the current registration settings. Associate this uid with the order and with the referenced customer profiles.
  3. Send an order invoice e-mail - can a user even view their own orders yet? - and/or an administrator notification for the order.

Comments

rszrama’s picture

Assigned: Unassigned » rszrama
Status: Active » Needs work
  1. The first Rule depends on changes to the Rules code listed in #1044308: "Fetch entity by property" has a configuration and evaluation problem. As a result, for alpha5 I'm going to leave the rule disabled by default.
  2. Ditto for the second... needed to define the user status property. There's a patch in #1044332: Define the status property for the core user and comment entity. Additionally, I can't actually make use of the newly created user account's uid. See #1044342: Errors creating and using newly created entities in rules.
  3. The third should be simple, but I'm burnt out from all this Rules debugging and need to head to bed. : P
rszrama’s picture

Status: Needs work » Needs review

Ok, the latest patches in #1044342: Errors creating and using newly created entities in rules make the rule to create new user accounts during checkout possible. If the 1044342_save_original_wrapper.patch isn't committed, the rule will need modification to load the user after saving it to get the new uid for the subsequent actions.

I also added in a simple e-mail notification for the new order with a link to the order's customer view page.

BenK’s picture

Subscribing

rszrama’s picture

To get around #1044332: Define the status property for the core user and comment entity, I've also added a definition for the user status property via the alter hook in a way that will not interfere once the Entity module starts defining it itself.

To get around the remaining issue with #1044342: Errors creating and using newly created entities in rules, I've changed the Rule to load the newly created user account immediately after creating it and using that fetched account to set the uid of the order. Unfortunately, we still need fago's patch in comment 6 to get committed. Once that happens, I can now default this rule to enabled and close this issue.

So, to test this, all you should need now is this patch: http://drupal.org/node/1044342#comment-4069856

rszrama’s picture

Status: Needs review » Fixed

And it's committed. Yay!

Status: Fixed » Closed (fixed)
Issue tags: -dcsprint5

Automatically closed -- issue fixed for 2 weeks with no activity.