Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | Customer profiles list without Name column.png | 31.08 KB | roball |
#7 | Billing information checkout pane with empty Addresses on File select options.png | 15.36 KB | roball |
#1 | addressbook_title_select.patch | 2.71 KB | zhilchenko |
Comments
Comment #1
zhilchenko CreditAttribution: zhilchenko commentedHere 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.
Comment #2
DuaelFrNice start but :
However, good job. Thank you :)
Comment #3
Simon Georges CreditAttribution: Simon Georges commentedHas there been some progress on that? Is someone working on it?
Comment #4
jsacksick CreditAttribution: jsacksick commentedThis is currently possible via code using the hook_commerce_addressbook_labels_alter() (See commerce_addressbook.api.php).
Comment #5
sumaiyajaved CreditAttribution: sumaiyajaved commentedI 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)
Comment #6
kratos91 CreditAttribution: kratos91 commentedI 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 ?
Comment #7
roball CreditAttribution: roball commentedWhen 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
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.
Comment #8
candelas CreditAttribution: candelas commentedsame problem
Comment #9
L5 CreditAttribution: L5 commentedSame issue here. Any solutions known yet?
Comment #10
roball CreditAttribution: roball commentedUnfortunately, 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).
Comment #11
mvdve CreditAttribution: mvdve commentedAs 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.
Comment #12
roball CreditAttribution: roball commentedThank 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.
Comment #13
Sanco CreditAttribution: Sanco commentedHello.
After using the patch from comment #1 have errors:
How to fix?
Comment #14
yuseferi CreditAttribution: yuseferi commentedI have the same problem in shipping information, customer profile select .
Comment #15
roball CreditAttribution: roball commentedUnfortunately, this problem has not been considered to be fixed in the latest release (7.x-2.0-rc8). Any plans?
Comment #16
mglamanroball, it hasn't been considered by the community to provide patches to help fix this. This isn't a bug in my opinion, as you should always have a zip code. A feature to change how the select option label is displayed is a feature.
Comment #17
roball CreditAttribution: roball commented@mglaman, did you view the following screenshot?
There are NO select option labels at all. The user just sees a select field with empty options. You want to say that is desired behaviour ???
Also, it has nothing to do with the ZIP code.
Comment #18
mglaman@roball, no I do not find that to be desired. However this issue is directed at use-case changes to Customer Profile entities - which is assumed to have an Address Field for Payment modules to properly process. Since this is the de facto setup in Drupal Commerce, this module assumes that as well. So it is a Feature request.
Looking at the screenshot, and based on the comment, I'm assuming there is malformed data and would need more info to investigate, or would more than willingly review a patch which adds support for this.
#1 looks like a proper approach, but it needs to check the field instances on the bundle, but that doesn't help identify sub-values within the field (each address component.)
Yesterday I went through the queue to triage the module, commit fixes, and get things moving again so that items like these can be considered without all the other technical debt amongst it.
Comment #19
radamiel CreditAttribution: radamiel commentedhttps://www.drupal.org/project/commerce_addressbook_extra - here is a module that allows to pick a field. For now it allows only any subfield from address field and textfields
Comment #20
roball CreditAttribution: roball commentedThanks radamiel, I am now using Commerce Addressbook together with your Commerce Addressbook Extra module, which solved this issue fine for me.