About
With the current 6.x-2.x-dev version of Extra Fields Pane (Sept 2, 2010) UC Addresses integration is not complete. This is mainly because there are not enough hooks available in UC Addresses to make the integration complete. When an address is added, there is no way for other modules to know which ID the new address got, so a change for uc_addresses is required.
Attached are a patch - to be applied on UC Addresses - and an extra module. Those two together will make UC Addresses integration (nearly) complete. (See other issues for possible missing features, for example: #913852: Fix 'saved addresses' dropdown on checkout page, they take care for UC Addresses integration themselves.)

I see this solution as a temporary solution. I think UC Addresses should be modified in a better and nicer way than the way I have done it now. The reason why I didn't did that yet, was because I do not yet have the time for it.
See #851658: save aid within form_state when new addresses are saved for discussion about possible improvements of UC Addresses. The maintainer suggests how UC Addresses could be improved.

Review
Please review this solution and tell me if it integrates UC Addresses with Extra Fields Pane enough for you.

Additional info
If you want to display the values of extra address fields on the address list page (e.g. /user/1/addresses), you can do this by overriding theme_uc_addresses_list_address() in your theme and use the theme function 'ucxfdev_ucaddresses_list_address' there:

<?php
function mytheme_uc_addresses_list_address($address, $panes) {
  return theme('ucxfdev_ucaddresses_list_address', $address, $panes);
}
?>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MegaChriz’s picture

FileSize
5.02 KB

The solution posted above works only with the 2.x-dev version of Extra Fields Pane from September 2.
Here is a new version of this solution, which will work with the 2.x-dev version of Extra Fields Pane from November 26 and December 2.

restyler’s picture

your zip files are not readable on my windows 7 :(
http://pix.am/dV0H/

MegaChriz’s picture

@restyler
Hm, that's odd. The files are UTF-8 encoded. Are you sure you opened the files as UTF-8?
Are you able to install the module? Or does it gave errors in Drupal?

restyler’s picture

that's odd, indeed!
the archive is working fine, so I can unarchive all the files. but when I try to open any file (.module, .info) all my editors fall back to hex mode with these weird symbols inside, and windows notepad renders it as Chinese symbols!
May be your utf8 encoding is somewhat.. non-standard? (like, BOM marks, I don't know)
I would appreciate if you could paste latest module file to http://pastebin.com. Thanks a lot in advance!

Regards, Anton.

MegaChriz’s picture

I posted the module at http://pastebin.com like you asked:
http://pastebin.com/RmdGZDw9

Is this what you meant?

restyler’s picture

yeah, thanks a lot! I'll give it a try!

MegaChriz’s picture

@restyler
Remember that for this solution to work, you also need to patch Ubercart Addresses. The zip file includes a patch for Ubercart Addresses. Were you able to apply the patch already?

restyler’s picture

for some reason, the patch from your second archive works fine (it's the only file that works fine for me)

I've patched uc_addresses, the extra fields appears during address edit, but during address browsing ( user/1/addresses/list ) the list is rendered as empty if I add


function acquia_marina_uc_addresses_list_address($address, $panes) {
  return theme('ucxfdev_ucaddresses_list_address', $address, $panes);
}

to my acquia_marina.

http://pix.am/PFKE/

and here is how it looks like when I remove this theme function from the theme:

http://pix.am/Luk0/

so, I think there is a problem with theming function.

restyler’s picture

Okay, I've just realized that was a problem in module files naming :) everything seems to work fine! thanks a lot!

MegaChriz’s picture

The recently created branch 6.x-2.x-redesign2011 has now integration code for Ubercart Addresses 6.x-2.x-dev on board. The code in this branch is considered less stable than the 6.x-2.x branch, so test it thoroughly before using it on a production site!
When the redesign is complete, the code from that branch will be moved to the 6.x-2.x branch and then this issue can be marked as fixed.

MegaChriz’s picture

Title: UC Addresses integration: temporary solution » UC Addresses integration
Status: Needs review » Fixed

The redesign is complete now. The latest development version of Extra Fields Pane (6.x-2.x) does now have a full integration with Ubercart Addresses 6.x-2.x.

Status: Fixed » Closed (fixed)
Issue tags: -uc_addresses

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