Re: Re: Re: Re: Storing Address information in User Profile
Storing Address information in User Profile (84 replies) Thu, 10/25/2007 - 18:04
- Profile Module integration (10/08/2009 - 09:17)
- CCK approach? (09/16/2009 - 00:23)
- Re: CCK approach? (10/28/2009 - 17:12)
- hook form alter solution (07/29/2009 - 07:59)
- majnoona@drupal.org (10/28/2009 - 16:12)
- The other way round! (08/23/2009 - 08:44)
- Re: The other way round! (09/07/2009 - 16:29)
- Last message (05/29/2008 - 11:35)
- Re: Last message (07/08/2008 - 09:04)
- Re: Re: Last message (04/11/2009 - 02:53)
- Where did this end up? (06/19/2009 - 07:57)
- Agree (07/26/2009 - 08:58)
- Where did this end up? (06/19/2009 - 07:57)
- Re: Re: Last message (04/11/2009 - 02:53)
- Re: Last message (07/08/2008 - 09:04)
- Re: Storing Address information in User Profile (05/21/2008 - 12:29)
- Using PostGRE? (05/22/2008 - 09:40)
- Re: Using PostGRE? (05/23/2008 - 13:15)
- Re: Re: Using PostGRE? (05/24/2008 - 16:18)
- Discovered a small bug.
I (05/24/2008 - 17:03)
- Duplicated bug report (05/26/2008 - 09:56)
- Module now on drupal.org (05/26/2008 - 16:44)
- Duplicated bug report (05/26/2008 - 09:56)
- Discovered a small bug.
I (05/24/2008 - 17:03)
- Re: Re: Using PostGRE? (05/24/2008 - 16:18)
- Re: Using PostGRE? (05/23/2008 - 13:15)
- Using PostGRE? (05/22/2008 - 09:40)
- A new version of uc_addresses (05/16/2008 - 22:21)
- Thanks for the support, everyone! (05/19/2008 - 08:39)
- Re: Thanks for the support, everyone! (05/19/2008 - 09:34)
- Thanks, Ryan (05/19/2008 - 10:25)
- Re: Thanks, Ryan (05/19/2008 - 20:33)
- bug? (05/21/2008 - 01:16)
- Re: Problems with new uc_addresses (05/21/2008 - 10:02)
- bug? (05/21/2008 - 01:16)
- Re: Thanks, Ryan (05/19/2008 - 20:33)
- Thanks, Ryan (05/19/2008 - 10:25)
- Re: Thanks for the support, everyone! (05/19/2008 - 09:34)
- Re: A new version of uc_addresses (05/19/2008 - 06:59)
- Well done Tony,I don't (05/17/2008 - 21:11)
- Re: A new version of uc_addresses (05/18/2008 - 02:22)
- Re: Re: A new version of uc_addresses (05/18/2008 - 12:37)
- Thanks for the support, everyone! (05/19/2008 - 08:39)
- Module (05/01/2008 - 09:57)
- Re: Module (05/03/2008 - 19:24)
- Re: Storing Address information in User Profile (03/21/2008 - 15:03)
- Re: Re: Storing Address information in User Profile (03/24/2008 - 09:46)
- Re: Re: Re: Storing Address information in User Profile (03/24/2008 - 15:36)
- rich wrote:Here's another (03/25/2008 - 20:07)
- Re: rich wrote:Here's another (03/30/2008 - 18:35)
- Re: Re: rich wrote:Here's another (04/10/2008 - 04:19)
- Re: rich wrote:Here's another (03/30/2008 - 18:35)
- rich wrote:Here's another (03/25/2008 - 20:07)
- Re: Re: Re: Storing Address information in User Profile (03/24/2008 - 15:36)
- Re: Re: Storing Address information in User Profile (03/24/2008 - 09:46)
- Current rollup patch (03/08/2008 - 01:58)
- Re: Current rollup patch (03/08/2008 - 05:00)
- Re: Re: Current rollup patch (03/08/2008 - 10:45)
- Re: Re: Re: Current rollup patch (03/08/2008 - 13:22)
- Re: Re: Re: Re: Current rollup patch (03/08/2008 - 15:01)
- Re: Re: Re: Current rollup patch (03/08/2008 - 13:22)
- Re: Re: Current rollup patch (03/08/2008 - 10:45)
- Re: Current rollup patch (03/08/2008 - 05:00)
- Re: Storing Address information in User Profile (10/26/2007 - 08:13)
- Re: Re: Storing Address information in User Profile (10/26/2007 - 16:53)
- Re: Re: Re: Storing Address information in User Profile (10/26/2007 - 22:36)
- Re: Re: Re: Re: Storing Address information in User Profile (10/30/2007 - 15:34)
- Re: Re: Re: Re: Re: Storing Address information in User Profile (10/31/2007 - 08:54)
- Re: Re: Re: Re: Re: Re: Storing Address information in User Prof (10/31/2007 - 09:25)
- Re: Re: Re: Re: Re: Re: Re: Storing Address information in User (11/08/2007 - 13:20)
- Re: Re: Re: Re: Re: Re: Re: Re: Storing Address information in U (12/08/2007 - 18:57)
- HOWTO: Make uc_store load profile addresses if they exist (02/23/2008 - 11:43)
- Thanks!
I hope you can get (02/23/2008 - 16:04)
- Re: Thanks!
I hope you can get (02/24/2008 - 12:51)
- Re: Re: Thanks!
I hope you can get (02/24/2008 - 15:26)
- Re: Re: Re: Thanks!
I hope you can get (02/28/2008 - 05:31)
- Re: Re: Re: Re: Thanks!
I hope you can get (02/28/2008 - 10:21)
- Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 12:08)
- Re: Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 12:24)
- Re: Re: Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 14:07)
- Re: Re: Re: Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 14:57)
- Thanks for that, bendiy. (03/05/2008 - 19:30)
- Re: Thanks for that, bendiy. (03/06/2008 - 07:42)
- Re: Re: Thanks for that, bendiy. (03/06/2008 - 08:03)
- Re: Re: Re: Thanks for that, bendiy. (03/06/2008 - 08:34)
- Re: Re: Re: Re: Thanks for that, bendiy. (03/06/2008 - 08:52)
- Re: Re: Re: Re: Re: Thanks for that, bendiy. (03/06/2008 - 11:07)
- Quote:My only critique is (03/06/2008 - 16:02)
- Re: Quote:My only critique is (03/06/2008 - 18:46)
- Re: Re: Quote:My only critique is (03/06/2008 - 19:53)
- Re: Re: Re: Quote:My only critique is (03/07/2008 - 03:43)
- Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 10:39)
- Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 14:57)
- Re: Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 19:55)
- Re: Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 16:46)
- Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 14:57)
- Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 10:15)
- Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 19:22)
- Re: Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 19:46)
- Thanks for the example. I (03/08/2008 - 04:59)
- Re: Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 19:46)
- Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 14:54)
- Re: Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 19:22)
- Re: Re: Re: Re: Quote:My only critique is (03/07/2008 - 10:39)
- Re: Re: Re: Quote:My only critique is (03/07/2008 - 03:43)
- Re: Re: Quote:My only critique is (03/06/2008 - 19:34)
- Re: Re: Quote:My only critique is (03/06/2008 - 19:53)
- Re: Quote:My only critique is (03/06/2008 - 18:46)
- Quote:My only critique is (03/06/2008 - 16:02)
- Re: Re: Re: Re: Re: Thanks for that, bendiy. (03/06/2008 - 11:07)
- Re: Re: Re: Re: Thanks for that, bendiy. (03/06/2008 - 08:52)
- Re: Re: Re: Thanks for that, bendiy. (03/06/2008 - 08:34)
- Re: Re: Thanks for that, bendiy. (03/06/2008 - 08:03)
- Re: Thanks for that, bendiy. (03/06/2008 - 07:42)
- Thanks for that, bendiy. (03/05/2008 - 19:30)
- Re: Re: Re: Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 14:57)
- Re: Re: Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 14:07)
- Re: Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 12:24)
- Re: Re: Re: Re: Re: Thanks!
I hope you can get (03/05/2008 - 12:08)
- Re: Re: Re: Re: Thanks!
I hope you can get (02/28/2008 - 10:21)
- Re: Re: Re: Thanks!
I hope you can get (02/28/2008 - 05:31)
- Re: Re: Thanks!
I hope you can get (02/24/2008 - 15:26)
- Re: Thanks!
I hope you can get (02/24/2008 - 12:51)
- Thanks!
I hope you can get (02/23/2008 - 16:04)
- Re: Re: Re: Re: Re: Re: Re: Re: Re: Storing Address information (12/10/2007 - 13:50)
- Hi
There's a typo in the (12/18/2007 - 07:48)
- Re: Hi There's a typo in the (01/26/2008 - 11:07)
- Hi
There's a typo in the (12/18/2007 - 07:48)
- HOWTO: Make uc_store load profile addresses if they exist (02/23/2008 - 11:43)
- Re: Re: Re: Re: Re: Re: Re: Re: Storing Address information in U (12/08/2007 - 18:57)
- Re: Re: Re: Re: Re: Re: Re: Storing Address information in User (11/08/2007 - 13:20)
- Re: Re: Re: Re: Re: Re: Storing Address information in User Prof (10/31/2007 - 09:25)
- Re: Re: Re: Re: Re: Storing Address information in User Profile (10/31/2007 - 08:54)
- Re: Re: Re: Re: Storing Address information in User Profile (10/30/2007 - 15:34)
- Re: Re: Re: Storing Address information in User Profile (10/26/2007 - 22:36)
- Re: Re: Storing Address information in User Profile (10/26/2007 - 16:53)

I've started to write this module and have run into a issue with the database table that I wanted to make sure was setup properly.
I've decided to create a table called uc_addresses like this:
<?phpfunction uc_addresses_install(){
drupal_set_message(t('Beginning installation of uc_addresses module.'));
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {uc_addresses} (
uid mediumint(9) NOT NULL,
location varchar(32) NOT NULL,
first_name varchar(32) NOT NULL,
last_name varchar(32) NOT NULL,
phone varchar(32) NOT NULL,
company varchar(64) NOT NULL,
street1 varchar(64) NOT NULL,
street2 varchar(64) NOT NULL,
city varchar(32) NOT NULL,
zone mediumint(9) NOT NULL,
postal_code varchar(10) NOT NULL,
country mediumint(9) NOT NULL,
created int(11) NOT NULL,
modified int(11) NOT NULL,
PRIMARY KEY (uid)
KEY location (location)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
$success = TRUE;
break;
case 'pgsql':
db_query("CREATE TABLE {uc_orders} (
uid integer NOT NULL default 0,
location varchar(32) NOT NULL default '',
first_name varchar(32) NOT NULL default '',
last_name varchar(32) NOT NULL default '',
phone varchar(32) NOT NULL default '',
company varchar(64) NOT NULL default '',
street1 varchar(64) NOT NULL default '',
street2 varchar(64) NOT NULL default '',
city varchar(32) NOT NULL default '',
zone integer NOT NULL defualt 0,
postal_code varchar(10) NOT NULL default '',
country integer NOT NULL default 0,
created integer NOT NULL default 0,
modified integer NOT NULL default 0,
PRIMARY KEY (uid),
KEY location (location)
);");
$success = TRUE;
break;
default:
drupal_set_message(t('Unsupported database.'));
}
if($success){
drupal_set_message(t('The uc_addresses table was installed successfully.'));
}
else{
drupal_set_message(t('The installation of the uc_addresses module was unsuccessful.'),'error');
}
}
?>
I think it is best to store each address in a separate row and not have two in a row like you have in the uc_orders table (delivery_field & billing_field). I have a column called "location" which will be used as the "label" or "save_as" mentioned above. I was looking at how Newegg.com has their user profile information setup and found out that you can have multiple addresses with the same label. You can create two addresses with the label "Home". The way I want to setup this module, the "location" will have to be unique. You cannot have more than one "Home", but you could have "Home2".
1. Do you think that it will be fine to force this field to be unique with form validation?
2. If you disagree, what would you use as a secondary KEY in the table so you will be able to select the proper row for a user which has multiple locations (Home, Home, Work, School, Billing, etc.)?
3. Newegg only allows one billing address per profile to be stored. I think this is fine. What do you think?
4. You mentioned above that this shouldn't be tied to a user so you can store address information from different modules. I'm having a hard time seeing any situations where there would not be a "uid" associated with an address. Can you elaborate on this?