1
Answers
Vote up!
0
Vote down!

Does the link between Customer Profiles <-> User 0 "break" Commerce Address Book?

(I'm quite new to Drupal Commerce and Commerce Address Book, so forgive me if my questions are ignorant. I'm piecing them together based on what I've read and observed.)

I've recently inherited a Drupal 7 site that uses Drupal Commerce. My client wants to find ways to cut down on redundant data entry of billing & shipping info for returning customers. No problem, I think -- Commerce Address Book is ideal for that. It works beautifully on the development server (very basic install, no fancy configurations), but fails to work on Staging (which has the custom configurations, naturally). Although the dropdown appears in the Billing Address section, and has an option in it, that option doesn't seem to be able to pull information from the Customer Profile side of things.

I *believe* what's happening is that anonymous/unauthenticated customer can buy products, and a customer profile is being created . . . but the checkout rule that would normally create a new user account to correspond with that customer profile has been disabled. So all anonymous customers are being linked with User 0.

I know I can re-enable the checkout rule to keep future customer profiles from being linked to User 0 (because I was able to replicate the issue on my development server), but that won't help me do anything for the 600+ previous customers.

Am I correct in attributing the breaking of Commerce Address Book to multiple, unrelated Customer Profiles back to User 0? Or is there some other nuance involved that I've missed?

If it is the prior linkage to User 0 that is causing the issue, is there some way I can get Commerce Address Book to infer the relationship between the user and their associated addresses? The idea of exporting all the customer profiles that link to User 0 and then mass creating user accounts isn't so daunting, but finding a way to link the customer profiles to the corresponding user account . . . I'm still a bit hazy on how I'd accomplish that, to be honest.

Asked by: Andrew_Imagine
on September 1, 2013

1 Answer

Vote up!
0
Vote down!

Some additional info:

I was able to get commerce addressbook working for a customer who also had a user account and made a purchase, so I know the commerce addressbook module code is definitely working properly.

On a hunch, I created a user account as a test for one of my anonymous customers-- associated the customer profile with the user account, and then one of the orders associated with that customer profile to the same user account, but Commerce Addressbook was not able to pull the address info from the associated orders for some reason.

I've analyzed the AJAX response, and it's returning a block of HTML with the Billing Information of the form to "swap in/out", but none of the fields are populated with the customer's information. When I look at the AJAX response from a customer with a Drupal user account, that address info is included in there.

As near as I can tell, there's got to be some other relationship besides Orders, Customer Profiles and User Accounts, but I'm not able to see what it might be. Any help?

Answer by: Andrew_Imagine
Posted: Sep 6, 2013