If the user creates a profile, and there are no other active profiles of that type, then the new profile should be set as default.

Files: 

Comments

Status:Active» Fixed

Committed.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

It is automatic? I've created a new order using a new user and the only customer profile is not the default.

And when i set as default one address using the link in the user page it doesn't prepopulate in the checkout.

¿i'm missing something?

Status:Closed (fixed)» Active

Instead of creating a new issue for the same problem, let's reopen this issue.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

I am using the stable release and I would love to see this implented in that release.
Any idea if and when that might happen?
It is a small thing but it makes ordering a little bit easier/faster for a repeat customer.

For people looking for quick solution, you can use the following module:

commerce_addressbook_fix.rar

The module will update the default profile of the user as soon as he or she changes his delivery adress from the dropdown or when making a new delivery address.

or use the following code:

<?php
function commerce_addressbook_fix_commerce_addressbook_callback_alter(&$commands, $form, $form_state) {
 
// Example.
 
global $user;
 
$profile_id = $form_state['values']['customer_profile_shipping']['addressbook'];
  if(
is_numeric($profile_id)) {
   
$customer_profile = new stdClass();
   
$customer_profile->uid = $user->uid;
   
$customer_profile->type = 'shipping';
   
$customer_profile->profile_id = $profile_id;
   
commerce_addressbook_set_default_profile($customer_profile);
  }
}
function
commerce_addressbook_fix_entity_insert($entity, $type) {
  global
$user;
  if(
$type=='commerce_customer_profile'){
   
$customer_profile = new stdClass();
   
$customer_profile->uid = $user->uid;
   
$customer_profile->type = 'shipping';
   
$customer_profile->profile_id = $entity->profile_id;
   
commerce_addressbook_set_default_profile($customer_profile);
  }
}
?>