You would either need to write a new function to test based on parent categories_id or you could change the code to read something like:
Code:
// test contents for Media Mail
$skip_media = false;
$chk_media = 0;
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','22');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','29');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','52');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','58');
if ($chk_media != $_SESSION['cart']->count_contents()) {
$skip_media = true;
}
$methods = array();
$size = sizeof($uspsQuote);
for ($i=0; $i<$size; $i++) {
list($type, $cost) = each($uspsQuote[$i]);
// BOF: UPS USPS
$title = ((isset($this->types[$type])) ? $this->types[$type] : $type);
if(in_array('Display transit time', explode(', ', MODULE_SHIPPING_USPS_OPTIONS))) $title .= $transittime[$type];
/*
$methods[] = array('id' => $type,
'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),
'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
*/
if ($type == 'MEDIA' && $skip_media) {
// skip Media Mail
} else {
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
}
}
$this->quotes['methods'] = $methods;