Now that Commerce Extras provides address population capabilities for Shipping & Billing customer profiles, it should expand to allow multiple values for each.

With Commerce Extra, addresses are stored in User Profile Address Fields (single field may be shared between shipping & billing).

Goals
- Allow multiple values for these User Profile Address Fields, then provide a drop-down selection list during checkout to choose which address (like http://drupal.org/project/commerce_addressbook )
- Add new addresses as additional values in User Profile Address Fields (to save them to use later)

The default address for each would be determined by weight. The user can re-arrange the addresses within their user/edit page.

Comments

magicmyth’s picture

Here's an initial patch that implements most of the request.

The old behavior is still there as a default option but now you can check a checkbox to enable selecting any of the other deltas in a multi-field select. When this is enabled a default is NOT selected. It would not be hard to add this as an option though.

I've added another Drupal variable, 'commerce_extra_address_populate_style_settings', which behaves near identical to the existing 'commerce_extra_address_populate_settings' (its an array keyed by the pane ID). I think these settings should probably be stored in the same variable but I didn't want to alter the existing variable's behaviour without first discussing with the authors/maintainers of the module on how multiple setting options should be stored.

magicmyth’s picture

Status: Active » Needs review

Forgot to update the issue status.

magicmyth’s picture

Damn left some debugging bits kicking around. Here's an update.

magicmyth’s picture

OK this will teach me to get some sleep before submitting stuff. I left in a hard coded address field name. This patch fixes that plus deletes the added variable when un-installed. I also did some minor coding style fixes (passes code review).