Currently, the first address line is used it identify the address book entry.
For companies, you often have the same "Address 1" content for different addresses.

It should be great if we had an additional field to allow us to choose the address name used in the dropdown and in the address book.

Comments

Status:Active» Needs review
StatusFileSize
new2.71 KB

Here is quick patch with such functionality. Apply it, go to admin/commerce/config/addressbook and select field for entry title. Users on checkout will see select box with this field values.

Status:Needs review» Needs work

Nice start but :

  1. Billing and Shipping profile types can have different fields so we cannot use just one title field selector for both of them
  2. Creating a field and using it as address book title on existing profiles gives a select box full of untitled entries which cannot be renamed because it just creates new entries

However, good job. Thank you :)

Has there been some progress on that? Is someone working on it?

This is currently possible via code using the hook_commerce_addressbook_labels_alter() (See commerce_addressbook.api.php).

I am using commerce kickstart, i required a simple address so I had removed the commerce dynamic form and had added custom cck fields. Due to which the address book entry names were coming blank. I tried using the above hook in a custom module but it not change anything.

So i hacked the module :(
went to
$options[$id] = $field_values[0]['thoroughfare'];
and changed it to
$options[$id] = "Address ".$id;

I basically want the title to come from the custom cck fields. Can you help me? (name of the cck field is field_area)

I have the same problem that sumaiyajaved, I`ve deleted the addressfield by and I want to select one of my new fields in order to appear in preovious addresses dropdown , Can you help me please ?

Title:Allow the user to chosse his address book entry's nameAll selectable profile names are blank if there is no "Postal address" field in the Customer profile
Version:7.x-2.x-dev» 7.x-2.0-rc7
Category:feature» bug
Priority:Normal» Major
Status:Needs work» Active
StatusFileSize
new15.36 KB
new31.08 KB

When the Billing information Customer profile type has no longer a Postal address field in it (as the default Commerce module bundle comes with), the administrative list of Customer profiles no longer contains a column "Name" (it only has "Profile ID", "User", "Type", "Status and "Operations") - see attached first screenshot.

As a consequence, on the Billing information checkout pane, the Addresses on File select list only contains empty select options - see attached second screenshot. The corresponding HTML is

<div class="form-item form-type-select form-item-customer-profile-billing-addressbook">
  <label for="edit-customer-profile-billing-addressbook">Addresses on File </label>
<select id="edit-customer-profile-billing-addressbook" name="customer_profile_billing[addressbook]" class="form-select ajax-processed"><option value="none">-- Choose --</option><option value="4" selected="selected"></option><option value="7"></option></select>
<div class="description">You may select a pre-existing address on file.</div>
</div>

Thus, the names displayed in the select options list, should not rely on other modules. Instead, it should generate its own names, maybe including the creation date. I think best would be to configure the generated name based on tokens.

same problem

Same issue here. Any solutions known yet?

Unfortunately, not yet, since the maintainer did not comment on this bug yet (beside #4, which does however not solve the blank options as by #5).

Category:bug» feature
Priority:Major» Normal

As mentioned in #4 You can use the API of addressbook to alter the dropdown name. Simply add the function to your template.php file and select the field you want to use.

<?php
/**
* Allows modules to alter the list of customer profile labels.
*
* During checkout the user selects the "address on file" from a dropdown list
* of customer profiles. The label used to represent each customer profile
* is the "thoroughfare" column of the addressfield. By altering the list
* of labels, a module can use additional data to represent each customer
* profile. Note that the list should always be keyed by customer profile id.
*
* @param $labels
*   An array of labels, keyed by customer profile id.
* @param $profiles
*   An array of customer profile entities.
*/
function hook_commerce_addressbook_labels_alter(&$labels, $profiles) {
 
// No example.
}
?>

Thank you mvdve for the tipp, but in the meantime I have removed this module from my sites, since I am now successfully using Commerce Single Address instead. It is not causing any problems for me out of the box.