If a user selects a previously saved customer profile and doesn't change the address information, there's probably not much use saving the customer profile as a new entry with a new profile ID. Although the user will one see one of them in the dropdown upon next checkout, this will still clutter the administrative backend with a lot of identical customer profiles if a user makes a lot of orders...

Comments

megensel’s picture

Project: Commerce Addressbook » Commerce Core
Version: » 7.x-1.x-dev
Component: Code » Customer

Moving to commerce_customer since this a task performed by that module.

svendecabooter’s picture

Ok.. thought this wouldn't be handled by Commerce core, but we'll see :)

rszrama’s picture

Status: Active » Fixed

With the most recent commits to the Customer module, this should no longer be a problem. The Order module is the module that hooks into customer profile saving to determine whether or not a new profile needs to be saved based on whether or not any field values have changed and the profile in question is referenced by other non-cart orders. (If it's only referenced by the current order, it can be updated as much as necessary.)

Based on my limited knowledge of the Addressbook code, my hunch is that this was a problem in the way the addressbook was interacting with the checkout form. What it should have been doing via its "address" select list was let the customer select a previous customer profile ID, not some hash of the address. Then, using the AJAX framework, it should detect the change, validate the profile, update the order field to actually reference the newly selected profile, and rebuild the form with the updated order. This would rebuild the billing information checkout pane with the previously used address data, and on save it would just save that profile instead of creating a new one.

I explained this process to one of our devs, jsacksick, in Paris and he's been working with it to make it do just that. I don't believe this is the way the module already worked, but please forgive me if it is.

Status: Fixed » Closed (fixed)

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