Currently the Billing Address is tied only to a Transaction, NOT to the Donor Details. This is because a login is required to store the address information and tie it to usermeta.
@DevinWalker dug into this today. Question is, can we safely and reliably tie the billing address to the donor data instead of usermeta so that billing information is saved for ALL donors, not just logged in donors.

As of right now it's being stored in usermeta which isn't optimal since Guests should have the ability to save address, additional emails, etc.
I like the discussion about a customer_meta table here: https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2548
I'm not sure where Pippin and company are on that...
Strongly agree that address information should be linked to the donor, not the transaction!
Pending completion of #653
Thinking this over: the "Billing Details" fieldset is currently being used for credit card transactions and cannot be used for donor's addresses because of the way each gateway is integrated with them.
We're going to need to create separate fields for the address fields which integrate into the "Personal Info" field set.
A few considerations:
Solutions to considerations:
1 & 2: - I propose that when _both_ the donor and billing address field sets are present that the billing address fields are hidden and a checkbox will expand and collapse them as necessary. They would be collapsed by default and the checkbox would ask: "Do you have different billing address?". If checked, then the additional fields appear. If not, the address fields from the donor's address are brought over.
3: Yes provide an option
Here's a quick concept of what I'm thinking:

@DevinWalker I agree with you on all 4 points. Both donor address and billing address need saved with each transaction. Current behavior shows that a registered user's address is updated to reflect the billing address used in their most recent donation. For this reason, we should continue to record the billing address separately as part of _give_payment_meta. By doing so, the billing address remains tied to the transaction even if the donor address changes in the future (another point for frozen transactions).
Regarding the checkbox, I recommend we:
For those reasons, I recommend a Billing Address section with a pre-checked box and the following label: Use my personal address as my billing address. Unchecking the box reveals separate billing address fields. This is a pattern I've seen in use in other e-commerce applications.
The question then becomes where to save the address info. Seems to me if we are going to start saving addresses for unregistered users in the wp_give_customermeta table, then we should keep all donor addresses there instead of splitting them between wp_usermeta and wp_give_customermeta. A migration function could address backwards compatibility by migrating addresses in wp_usermeta to wp_give_customermeta when Give is updated.
@kevinwhoffman that's nearly exactly what I'm thinking we do. The CC billing address is currently stored in _give_payment_meta attached to the transaction. Which is fine because the payment
Here's my rundown of the line items:
wp_usermeta to wp_give_customermeta table[give_profile] shortcode will need some retooling to account for the address updates:
Notice how it has the "Change Your Billing Address" which pulls from wp_usermeta. This will need to change to pull from wp_give_customermeta.
Final note: because of the UI significance of this and the major admin UI shifts we are making in release/1.8 I feel this issue is better suited being added to that milestone. Therefore, I'm going to bump the milestone to 1.8.
@DevinWalker I agree with all of the above.
This is still causing headaches for folks trying to export donor info for creating tax reports.
More reports from users wanting to use the "Export Donors in CSV" tool and not seeing the address info there at all.
https://secure.helpscout.net/mailbox/f26ecd815eb729ba/672201/
As an interim solution the "Export Donor History" tool exports the addresses, but if a donor gave multiple times then it lists those duplicates, so the admin has to exclude duplicates from the CSV file in order to use for lists and whatnot.
Most helpful comment
@kevinwhoffman that's nearly exactly what I'm thinking we do. The CC billing address is currently stored in
_give_payment_metaattached to the transaction. Which is fine because the paymentHere's my rundown of the line items:
wp_usermetatowp_give_customermetatable[give_profile]shortcode will need some retooling to account for the address updates:Notice how it has the "Change Your Billing Address" which pulls from
wp_usermeta. This will need to change to pull fromwp_give_customermeta.Final note: because of the UI significance of this and the major admin UI shifts we are making in
release/1.8I feel this issue is better suited being added to that milestone. Therefore, I'm going to bump the milestone to1.8.