NOTE: there were some changes to the March 27, 2013 USPS shipping module ...
To clarify the customization needed for usps.php, you would add the code in RED to the function update_status:
Code:
function update_status() {
global $order, $db;
if (IS_ADMIN_FLAG == TRUE) return;
// disable when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
}
// bof: allow 1 zone only for Always Free Shipping
// global $db, $order, $cart;
//echo 'I see quantity: ' . ($_SESSION['cart']->in_cart_check('product_is_always_free_shipping', 1)) . '<br>';
$valid_zone_id = 2;
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . $valid_zone_id . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag == true) {
if ($_SESSION['cart']->count_contents() == $_SESSION['cart']->in_cart_check('product_is_always_free_shipping', 1)) {
$this->enabled = false;
} else {
$this->enabled = true;
}
} else {
$this->enabled = true;
}
// eof: allow 1 zone only for Always Free Shipping
if ($this->enabled == true) {