I've been searching both at D.O and here if adding additional fields to the address form will be implemented. It's not a big deal but my client is asking if it is possible. I had to hack the core UC files as well as the UC Addresses module in order to add one field. I just want to know if it is possible to dynamically add additional fields if needed. Thanks.
It's always possible, but at this point it isn't necessarily easy. You'll have to use hook_form_alter() to add the field into the address fieldsets. You'll then have to override the address pane theme functions which have some pretty horrid theming code in them to get your new field to display. Because the order table doesn't just dynamically expand to accept new fields, you'll also need a separate database table to store data for these custom fields in relation to your orders... you might get away w/ stuffing the data into $order->data.
At the end of the day, I usually ask the client... "Do you really need this?" If so... "Does it really make sense as part of the address, or can we include a custom checkout pane to take care of it?" A custom checkout pane takes a bit of work, but it's going to be easier to do.
I tried the VAT number module that adds this to $order->data. The problem I see with it is that the information is not retrieved with the returning client address. The client would need to enter the VAT number with every new order.
I am now inclined to just patch the order module and add the field there, because Europe is not small, growing and UC should not discriminate EU tax needs. Since UC allows to deactivate fields, I don't think there is any problem adding new fields at user request, is there?
What you think? Any advice (like above) how to go about adding a field this way?
Was having a similar issue. This worked for me:
http://www.ubercart.org/contrib/13826#comment-47293
Updating broken link. Use this link instead: http://drupal.org/project/uc_extra_fields_pane
