Hi sorry not a dev but I think it would be nice if an 'admin' user could:

1 - Select any profile instead of the one used previously
2 - Use a field with search function instead of dropdown

The idea is the cases in which an old customer call via phone to order customer service. The person on the line should be able place the order for him.

Maybe is completely stupid, but I do not think would be much work to create it.



Version:7.x-1.x-dev» 7.x-2.x-dev

Moving to 7.x-2.x
This is not on my roadmap. Patches welcome.


Any solution?


Assigned:Unassigned» smaz
Status:Active» Needs review
new4.52 KB

Hi there,

We needed this functionality for a company project, so I've created a patch:

  • Added a new permission 'use any address', which allows users to select a user & use one of their saved addresses
  • For those with permission, added a user lookup field to the billing settings screen. Once a user is chosen, the address dropdown is shown with their addresses.

Please note that in order to use the ajax user lookup field, a user will also need the 'administer users' permission. It also will not raise the order in the selected users name - I think that's out of scope for this module.

Testing & feedback welcome!

i re-worked the previous patch:
- move the altering code to helper function so it could be used in other cases (#1717234: As an administrator adding a shipping address to an order, I want the ability to search for existing accounts / addresses)
- use existing "administer commerce_customer_profile entities" permission instead of having new permission (ex. 'use any address').
- Order edit form implementation started - #1717234: As an administrator adding a shipping address to an order, I want the ability to search for existing accounts / addresses

I think it requires at least some testing. thank you

- Order edit form : i have no success to populate the profile form with data from selected one.
- probably others from tests

Status:Needs review» Needs work

I've just tested this and can confirm that the user search and address book functionality works very well. With address population, this would be perfect for setting up customer orders from the admin interface.

Assigned:smaz» Unassigned
Status:Needs work» Needs review
new15.49 KB

The patch in #6 works for me. I did get an error for a basic user because global $user wasn't included in commerce_addressbook_profile_field_form_alter(). I've attached a patch that fixes this.

I think this is good as is, but I'd like to see some support for someone between an admin and a basic user to do this. Like a Sales Rep. The 'administer commerce_customer_profile entities' permission may be a little to open for that type of user. I may need to add in support for some new hooks to work in my use case. I'll keep kicking the tires on this patch and see if there's other changes that need to be made.

Issue summary:View changes

I have applied patch in #8 however when I choose the address it does not populate the fields below the selection therefore it never gets saved. I am looking into it at this point.

I have been digging in this for a bit. I cannot seem to find where the issue is. When I choose an address on the checkout form all works fine for both being logged in as user 1 as well as getting the current user's address.

The functionality fails without error though on the "admin/commerce/orders/add" page.


Experiencing exactly as #9

I'm finding that #9 creates empty profiles every time I try to select an existing one :(

Ok I have managed to fix the issue I have experienced please test and confirm. I have just added to #8's patch.


Woops This one is better. Accidentally forgot one thing.