Try this ...
Customize the USPS shipping module:
/includes/modules/shipping/usps.php
and add the code in Red around line 305 or so:
Code:
if (isset($uspsQuote['Package']['Postage']) && zen_not_null($uspsQuote['Package']['Postage'])) {
$PackageSize = 1;
} else {
$PackageSize = ($this->usps_countries == 'US') ? sizeof($uspsQuote['Package']) : sizeof($uspsQuote['Package']['Service']);
}
// bof: test for media mail eligible
$cart_count = $_SESSION['cart']->count_contents();
$chk_products = 0;
$media_valid = true;
$chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','4');
$chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','5');
$chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','6');
$chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','7');
if ($cart_count == $chk_products) {
$media_valid = true;
} else {
$media_valid = false;
}
// eof: test for media mail eligible
for ($i=0; $i<$PackageSize; $i++)
and then add the code in Red 418 or so:
Code:
$title .= $this->transittime[$type];
// bof: test for media mail eligible
if ((($method == '' && in_array($type, $types)) || $method == $type) && $usps_shipping_weight <= $maxweight && $usps_shipping_weight > $minweight) {
//echo 'USPS $type: ' . $type . '<br>';
if ($type == 'Media MailRM' && !$media_valid) {
// skip media
} else {
$methods[] = array('id' => $type,
'title' => $title,
'cost' => $cost,
);
}
// eof: test for media mail eligible
}
}
if (sizeof($methods) == 0) return false;
see if that shows Media only when Products are in categories 4, 5, 6 and 7 ...