3 replies [Last post]
a_c_m@drupal.org's picture
Offline
Bug Finder
Joined: 01/02/2008
Juice: 288
Was this information Helpful?

Idea: Fill the saved email addresses with *ANY* saved address by that user, not just the addresses of that type.

At the moment, if you say buy a download (with no delivery address), the come back to the site and buy a item which requires a delivery address, you cant use your saved billing address to fill out your delivery address.

What do people think?

a_c_m

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Saved addresses

Hmm... good point. I'm curious how http://drupal.org/project/uc_addresses handles this. Puzzled

a_c_m@drupal.org's picture
Offline
Bug Finder
Joined: 01/02/2008
Juice: 288
Re: Saved addresses

LOL, i've come back to upgrade the site i build with UC 2 years ago and running into the SAME problems 2 years later.

Looking into this again.

a_c_m@drupal.org's picture
Offline
Bug Finder
Joined: 01/02/2008
Juice: 288
Re: Re: Saved addresses

Very simple 'mini' hack to get this to work in us_store:

<?php
/**
* Create an address select box based on a user's previous orders.
*
* @param $uid
*   The user's ID to search for in the orders table.
* @param $type
*   Choose either 'shipping' or 'billing'.
*/
function uc_select_address($uid, $type = 'billing', $onchange = '', $title = NULL, $icon_suffix = FALSE) {
 
$addresses = uc_get_addresses($uid, 'billing');
 
$addresses = array_merge($addresses, uc_get_addresses($uid, 'delivery'));
?>

Ideally this could be turned on and off by a config option.