diff --git a/includes/commerce_addressbook.user.inc b/includes/commerce_addressbook.user.inc index f565efc..dfe0e48 100644 --- a/includes/commerce_addressbook.user.inc +++ b/includes/commerce_addressbook.user.inc @@ -115,11 +115,19 @@ function commerce_addressbook_profile_options_delete_form_submit($form, &$form_s * Used for both ajax and non-ajax delivery of the customer profile updates. */ function commerce_addressbook_profile_options_default($account, $customer_profile, $type = 'ajax') { + // Check if the user already have defaults addresses before setting one. + $defaults_view = commerce_addressbook_retrieve_view('commerce_addressbook_defaults', 'default', array($account->uid, $customer_profile->type)); commerce_addressbook_set_default_profile($customer_profile); if ($type == 'ajax') { $commands = array(); - $commands[] = ajax_command_replace('#commerce-addressbook-' . $customer_profile->type . '-default', '