Hi.
I think it`s bad behaviour, that uc_addresses module saves addresses from anonymous users.
Everyone could re-use your address when you buy something and and didn`t register in shop.
Correct my If I`m wrong.

I think that It`s very easy to correct this.
I`ve add

 if( $address->uid != 0 ){

at the beginning of:

_uc_addresses_db_add_address

btw. sorry form my english.

Comments

freixas’s picture

Assigned: Unassigned » freixas
Category: feature » bug

Thanks for the bug report (I consider this a bug, not a feature request).

Despite having produced this module, I am still pretty new to Ubercart, so I didn't consider the implications for anonymous checkout. I just went through the sequence of placing an order without being logged in and duplicated your problem.

At minimum, I can put in your fix. What I'm going to try to do, though, is save the address until an account is created for the user (I'm assuming every anonymous order creates a new account--I hope that's correct). Then I'll have a uid for the user and can insert their billing address as their default address. If the shipping address is different, I should save that as well.

I will report back as soon as I have more information.

freixas’s picture

Status: Active » Fixed

I just checked in a fix for this.

If an anonymous user places an order and if an account is automatically created for that user, the addresses on the order will be added to the user's new account. The billing address will become the default address. If a separate shipping address is provided, it will be added to the list as well.

If the anonymous user uses an existing e-mail address when placing the order, the order is associated with the existing user, but the addresses are not added. I consider this a low-priority problem and I would have to do some work to figure out how to get notified about the user assignment.

freixas’s picture

Status: Fixed » Closed (fixed)

Fix is in 5.x-1.x-rc3.