function commerce_addressbook_commerce_customer_profile_update in Commerce Addressbook 7.2
Same name and namespace in other branches
- 7.3 commerce_addressbook.module \commerce_addressbook_commerce_customer_profile_update()
Implements hook_commerce_customer_profile_update().
Set the last updated customer profile as default if there's none.
File
- ./
commerce_addressbook.module, line 580 - Defines addressbook functionality for customer profiles, allowing them to be reused and managed on a per-user basis.
Code
function commerce_addressbook_commerce_customer_profile_update($profile) {
if (!empty($profile->profile_id) && $profile->uid != 0) {
$default_profile = commerce_addressbook_get_default_profile_id($profile->uid, $profile->type);
if (!$default_profile) {
commerce_addressbook_set_default_profile($profile);
}
}
}