Fix performance of wpsc_get_child_object_in_terms

also updated code to standards