function commerce_addressbook_commerce_customer_profile_delete in Commerce Addressbook 7.3
Same name and namespace in other branches
- 7.2 commerce_addressbook.module \commerce_addressbook_commerce_customer_profile_delete()
Implements hook_commerce_customer_profile_delete().
File
- ./
commerce_addressbook.module, line 359 - 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_delete($profile) {
if ($profile->uid) {
$default_profile_id = commerce_addressbook_get_default_profile_id($profile->uid, $profile->type);
if ($default_profile_id == $profile->profile_id) {
commerce_addressbook_delete_default_profile($profile->uid, $profile->type);
}
}
}