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 did some digging into the Ubercart modules today and have a better understanding of how address data is stored and how it could work with user profiles.
My Observations (correct me if I'm wrong)
1. There is currently only one place that pulls old address data for use in the future. This is in the /cart/checkout form under the "Saved Addresses:" field. It does a database query on "uc_orders" for each unique address that a user has used in the past. That query is in the uc_get_addresses() function in uc_store.module.
2. Editing an order pulls the address info from the table "uc_orders" with the function uc_order_load() in uc_order.module.
My Proposal
1. I would like to create a module that adds a table "uc_user_addresses" to the database and contains a function uc_add_user_address() that will save an address to this table when an order is submitted.
2. The "uc_user_addresses" table would contain the same address info like "delivery_" and "billing_". It could also contain a "save_as" column that could be used to save multiple addressed like "Home", "Work", etc.
3. The module would only allow a single address per "save_as" type per user. Currently with the uc_get_addresses() function, you can have multiple addresses that could refer to the same location if they submit a second order and type in their address with a slight variation. For example, if it was "123 55th Ter." and they changed it to "123 55th Terr" when they submitted a second order.
4. In the check out form, add a "Save Address As:" drop down with a few "save_as" types.
5. Change the uc_get_addresses() function to use an if() statement to pull addressed from the new "uc_user_addresses" table if it exists, else, do the current query on the "uc_orders" table to provide backwards compatibility. This should allow the "Saved Addresses:" drop down on the /cart/checkout form to populate with either the new "uc_user_addresses" data or the "uc_orders" history data.
6. Add "Temporary Change" and "Permanent Change" radios to the /admin/store/orders/1/edit form. "Temporary Change" only updates the "uc_orders" table. "Permanent Change" updates both the "uc_orders" table and the "uc_user_addresses" table.
What do you think about this? It doesn't seem as hard as I thought it would be now that I've got it outlined. Although, I've never created a module before, but what better time to start then now?