
Originally Posted by
Ajeh
NOTE: the global $cart; needs the $cart and not cart in both places ...
that fixed it. i applied that code to both usps, and the per item as a test, and both options are still available for all categories, except for the free shipping items.here's what i have in the usps.php:
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);
}
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_cat_1 = $_SESSION['cart']->in_cart_check('master_categories_id','1');
if ($chk_cat_1 == $_SESSION['cart']->count_contents()) {
$this->enabled = false;
}
}
if ($this->enabled) {
// check MODULE_SHIPPING_USPS_HANDLING_METHOD is in
$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_HANDLING_METHOD'");
if ($check_query->EOF) {
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box', 'MODULE_SHIPPING_USPS_HANDLING_METHOD', 'Box', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\'Order\', \'Box\'), ', now())");
}
}