function commerce_addressbook_commerce_customer_profile_update in Commerce Addressbook 7.3
Same name and namespace in other branches
- 7.2 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 347 - 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 ($profile->uid) {
$default_profile_id = commerce_addressbook_get_default_profile_id($profile->uid, $profile->type);
if (!$default_profile_id) {
commerce_addressbook_set_default_profile($profile);
}
}
}