Re: Re: Re: Re: Re: Thanks for that, bendiy.

Posts: 41
Joined: 09/07/2007

My only critique is that you have added code from other parts of the module to the uc_addresses_user function. I'm not a programmer by trade, but I think the concept of Object Oriented Programing is to not reuse code, but to reference/use one function over and over to do what you need.

I think you can get your form for registration by using the uc_addresses_pane_address() function in the uc_addresses_address_pane.inc file. If you added another "case" to that function for 'register' (or just use the 'new' case) and added a hook_menu() to the uc_addresses_menu() function for the path that a user registers at, I think it would work.

You can also perform the insert into the database with the uc_addresses_add_address function near the bottom of uc_addresses.module.

It just makes it easier to maintain in the future.

I'm not sure how to override the forms at check out without editing the Core Ubercart code. That was my next step for development on this module. I know it can be done without making changes. There is a hook that should work, I just haven't had time yet to figure it out. I believe it is the hook_form_alter() function. You can probably use that to insert your address form at registration also. Just use hook_form_alter() to override the default registration form. You will have to make sure a recreate the existing form though (username, email, password, etc.), but you can copy from the default and just add to it.

I hope this helps. They just released the new version of PostBooks ERP system yesterday, so now I can finish the implementation I've been working on. Hopefully it will go smooth so I can finally finish this module soon.

Cheers!

Storing Address information in User Profile By: bendiy (74 replies) Thu, 10/25/2007 - 19:04