I love this module but always seem to battle to integrate it nicely with my users account page. I often use the content profile nodes as profiles approach and it would be amazing if there was some way to turn entering the default address into a cck field.

This way it could be easily integrated into registration forms and would be much more versatile.

Firstly, is it in the scope of this module to do something like this?
Secondly who is smart enough or keen enough to take on the challenge?

I can help test and possibly sponsor development on this request.


#5 uc_addresses.patch10.14 KBidevit
Members fund testing for the Drupal project. Drupal Association Learn more


freixas’s picture

Assigned: Unassigned » freixas

Hmmm... I'm not an expert on CCK and I'm not quite sure if what you are proposing makes sense or will solve your problem.

A CCK field, as I understand it, is just a way of capturing some user input and storing it as part of some content type. So you create your form, you add a CCK field to it and capture an address. Now what? uc_addresses would not know anything about this address as it expects addresses to be stored in its own tables.

Maybe CCK allows fields to be defined such that the data can be stored in the uc_addresses' tables and the node would just get an association? If so, then what happens if uc_addresses deletes an address? How would it know where all the associations to the data might exist?

You mention that the CCK field would enter the default address. The requires adding even more smarts to the CCK address field. What if the default address already exists? Should the field be pre-filled? Are you overwriting the default address or creating a new address and making that the default?

Maybe a CCK expert will comment on this and perhaps there is a straight-forward way of handling this with CCK.

I don't have any time right now to investigate CCK to see if this feature is possible, sorry. If you find an answer to any of my questions, please add them this issue. It might make more sense to add some hooks to uc_addresses, but using hooks to add the functionality you want requires programming.

iaminawe’s picture

Cool thanks for looking into it.

I guess the next best thing would be is there any code I could use to put the default uc_address fields into an existing profile node form.

So I would like to include the ability for my users to add an address on registration or editing without having to go to the separate "address" tab

I can't use the default include on registration form functionality as I have several different types of members and I only need to collect addresses for some of them

Thanks for any advice or guidance

freixas’s picture

Status: Active » Postponed

Unfortunately, there is no existing code that I'm aware of that does what you want.

I usually add features to uc_addresses if I need them for my own use or if I have the free time and interest in adding the feature. Right now, the current feature set works for me and I don't have the time to add this feature. Even if I did, I would probably just create some hooks and you would still need to write custom code to use the hooks to do what you want.

Priority goes to paid work, of course. Send me a message if you are interested in hiring me to create a solution for you.

I am marking this postponed for now.

iaminawe’s picture

Thank you

idevit’s picture

10.14 KB

The fields of uc_address are borrowed from the uc_store.module
So in order to create custom fields we can't use uc_get_field_name

The easy solution is to 'hack' a custom field variable in;
in my case the dutch VAT number called 'kvk', we wanted it directly under company.

You can add whatever field you want to use as long as its consistent.

as feature request a hook to CCK fields would be nice from UC
here is the patch file for uc_addresses version 6.x-1.0

freixas’s picture

Assigned: freixas » MegaChriz