To manage the shipping so that you only see Flat Rate when all Products are from categories_id 4 and when a mixed cart or no products are from categories_id 4 show USPS you can use the code in RED:
/includes/modules/flat.php
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
// bof: only show shipping if all products in the cart are from category 4
$chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
if ($chk_cat != $_SESSION['cart']->count_contents()) {
$this->enabled = false;
}
// eof: only show shipping if all products in the cart are from category 4
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
and in the USPS module use the code in RED:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code) == FALSE) $this->enabled = FALSE;
// bof: only show shipping if all products in the cart are not from category 4
$chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
if ($chk_cat == $_SESSION['cart']->count_contents()) {
$this->enabled = false;
}
// eof: only show shipping if all products in the cart are not from category 4
if ($this->enabled == true) {