It is better if "Addresses on File" can be switched between "Select list" type or "Autocomplete Widgets" type. Because if a user has many profiles, it is difficult to do with Select list.
Example with a "term reference" field, you can chose many type to add value: "Select list. Autocomplete, Check box, ...
How to do this?

Comments

drvdt’s picture

Issue summary: View changes

Add some text more

bojanz’s picture

Category: feature » support
Status: Active » Fixed

The user should never have that many addresses to require an autocomplete field.
Remember, this is used for addresses of a customer, and there's normally only a few. On how many addresses can a customer live? Surely not more than 10 (and that's a bit insane too :P).

That said, you could make a module, give it a weight (so that it's executed after commerce_addressbook), then use hook_form_alter() to modify the element.
Would also require you to write an autocomplete callback for customer profiles. See commerce_addressbook_form_alter() -> this is where Commerce addressbook adds the element.

drvdt’s picture

Ok,
I have understood about target of customer profile. Maybe i have chose a wrong way.
Thank you so much

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Repair wrong words

lalbright’s picture

Issue summary: View changes

@bojanz: per your comment "The user should never have that many addresses to require an autocomplete field.".

I understand your generalization, and this is generally true for most business models. However, my client operates a B2B and allows his customers to drop-ship to their customers address(es). In my case, I cannot use the Address Book because their clients ship to 5-10 customers per day. Multiply by 365 days a year and so on, and this is a classic example of a valid business model where the number of shipping addresses is way beyond what you might call the normal 5-10. In my opinion, I don't even want an auto-complete field, but I too could easily see where that would be helpful.

In my opinion, a developer could add an admin configuration screen (not just in the Shipping Field Configuration) for the Address Book where one could specify a field to use from the shipping profile that could be optionally used to limit what results are returned in the Address Book widget on the Check-out shipping page. For example, one should be able to add a field in the shipping profile, like "Show in Address Book", then visit the admin page for the Address Book and (optionally) select that field (from a list of fields used in the available profiles) to limit the results returned.

I added that field in my shipping profile, and it displays on the check-out page in Shipping Information, but there is obviously no GUI based hook or configuration settings that would allow me to limit the list.

Since I am not a developer, asking me to write a custom module isn't something that makes sense to me, or is even possible for me. Sure, I could try to cough up development dollars for this, but this sounds like a reasonable enhancement request and would most likely bolster Drupal Commerce support from those building for B2B's as they are likely facing similar issues. It would be great (for everyone considering its overall helpfulness and the fact that it could be coded as an option) if this could get into the build as a feature request.