function cw_user_delete_address($customer_id, $address_id)
{
    global $tables;
    \Customer\Address\delete($address_id, $customer_id);
    if ($address_id > 0) {
        db_query("DELETE FROM {$tables['register_fields_values']} WHERE key_id='{$address_id}' AND key_type='A'");
    }
    cw_user_check_addresses($customer_id);
}
function on_customer_delete($customer_id)
{
    \Customer\Address\delete(null, $customer_id);
}