How to theme Commerce Customer profile? In a Commerce project, I added some custom fields to the customer profile, and I’m using Addressbook. The customer profile is now displayed in the address book tab of each user page. 

I need to change the display of this address book. Until now :


I changed basic display settings of the fields in the "Manage Display" form, and this had a surprising effect : setting a label as hidden removed completely the default theming of all the view.
I tried to use hook_field_formatter_info() and hook_field_formatter_view() as per that Clive answer : this is great but it alters only the native AddressFields, not the custom fields of the customer profile.
In the Commerce Addressbook Defaults  view, source of the display, there's only one field in the view : Commerce Customer Profile: Rendered Commerce Customer profile.




I could call the fields one by one in the view, but what if I want to alter directly the  Rendered Commerce Customer profile field ? Where is it built, and how can I theme or alter it?
Generally speaking you can theme field output like other Drupal output. If you use devel_themer* you can normally see the template used and suggestions available. By default fields use theme('field') which by default has a number of suggestions:

// Add specific suggestions that can override the default implementation.
$variables['theme_hook_suggestions'] = array(
  'field__' . $element['#field_type'],
  'field__' . $element['#field_name'],
  'field__' . $element['#bundle'],
  'field__' . $element['#field_name'] . '__' . $element['#bundle'],
);


For example, the first suggestion allows you to override the template/function used for a particular type of field. In this case we could create MYTHEME_field__addressfield() and it would be used for addressfields only. You can add your own suggestions as well.

There are some field API routes as well though. You can use contrib or custom formatters (some of which in turn provide their own theme functions that you can override). Formatters can have settings that might give the results you want. You can add extra settings with a contrib module if you want to extend a formatter. There are also some field-specific hooks that might be useful:


hook_field_attach_view()
hook_field_attach_preprocess_alter()


&ast; As you say devel_themer is heavy. It massively changes the markup, and often messes up your JS. I only ever switch it on when I need it and then switch if off immediately afterwards, YMMV!