Could I please request that the README.md file be updated to add this notation:

To avoid creation of duplicate user accounts (and perhaps even duplicate orders), be sure that the Commerce Checkout rule "Create a new account for an anonymous order" is disabled.

My apologies for not providing a patch. I'm still learning how to do that. If I'm able to figure that out before there is a solution to this request, I'll post it.

Many thanks,
Anne

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anneeasterling created an issue. See original summary.

Kingdutch’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Component: Documentation » Code
Status: Active » Needs review
FileSize
715 bytes

The attached patch is not for documentation but will actually perform the action for the user by using hook_default_rules_configuration_alter.

Kingdutch’s picture

FileSize
764 bytes

The previous patch had a slight issue:

commerce_checkout_password_default_rules_configuration_alter will set the 'active' property to false on the 'commerce_checkout_new_account' rule whether that rule exists or not. Causing the following error:

Warning: Creating default object from empty value in commerce_checkout_password_default_rules_configuration_alter() (line 17 of commerce_checkout_password/commerce_checkout_password.rules_defaults.inc).

This version of the patch adds an if statement to check if the rule actually exists before disabling it.

cravecode’s picture

Thanks for the followup testing @Kingdutch!

cravecode’s picture

Assigned: Unassigned » cravecode
cravecode’s picture

@anneeasterling and @Kingdutch,
On a fresh install of Commerce Kickstart 7.x-2.45, I can't replicate the duplicate user behavior. I've ran several test orders with "Create a new account for an anonymous order" and Commerce Checkout Password enabled, without issue.