If a user has no saved addresses, let them save the ones they enter on the checkout form
dww - November 9, 2009 - 18:25
| Project: | Ubercart Addresses |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I searched the issue queue and didn't see any existing feature requests for this -- apologies in advance if this is duplicate...
If a user doesn't have any saved addresses in their profile, it'd be nice to alter the checkout form to add a "Save this address" checkbox, and perhaps an "address nickname" field that appears once you check the box. Then, once you submit the checkout form to review the order, the address is saved into their profile as if they had used the /user/N/addresses/add form.

#1
I thought of this when I created the module but was unable to make it work. The idea was that each customer would decide whether or not to have a particular address saved.
However, the module is set up so that you (as admin) can save all addresses typed in at checkout, even ones for anonymous users. The module stores the addresses and waits for the account to be created. Once the account exists, it adds the addresses. Unfortunately, you don't get to specify a nickname during checkout. If an address already exists, it isn't added, of course.
Does this meet your needs?
#2
I don't understand. How can I save these addresses entered in checkout?
In my case only registered users can checkout and no address is saved after payment is completed.
I see that in page admin/store/orders/%/edit all addresses are accessible. Is there an easy way to save them automatically to user account? I just want that if there is no address entered in user account then module saves it as default and if there is modules saves it new one.
Thank you.
edit:
the problem is with payment modules which alter submition form. In my custom module I use: unset($form['submit']). The same way paypal module works, but I haven't tested it.
So hook_order with $op == 'submit' is never called.
To make it work I've changed uc_addresses_order function:
from:
if ($op == 'submit' && $order->order_status == 'in_checkout') {
to:
if (($op == 'load' || $op == 'submit')&& ($order->order_status == 'in_checkout' || $order->order_status == 'pending')) {