I am looking for a similar option. All our books & DVD's are in a category - My thought would be that if all the items in the cart are from that category, Media Mail is an option - or conversely, if there is an item in the cart that is not from that category, Media Mail is disabled.
I made a hack to the UPS and USPS modules that when the cart is over 200lbs they are disabled - and conversely, in the flat rate, on orders over 200lbs the flat rate in enabled... here is the code
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
}
// disable module if weight is above 200 lbs:
if (IS_ADMIN_FLAG === false) {
if ($_SESSION['cart']->show_weight() > 200) $this->enabled = false;
}
So... would something similar to this wrapped around the Media Mail option in the USPS module work - just a simple if/then statement?
If so, how can you check an item in the cart to see what category it's from?