Not sure if I did something wrong, but it shows FedEx no matter what. Below is the first section of the module code:
PHP Code:
<?php
class fedexwebservices {
var $code, $title, $description, $icon, $sort_order, $enabled, $tax_class, $fedex_key, $fedex_pwd, $fedex_act_num, $fedex_meter_num, $country;
//Class Constructor
function fedexwebservices() {
global $order, $customer_id, $db;
@define('MODULE_SHIPPING_FEDEX_WEB_SERVICES_KEY', 'PpFEn9QGjnR4Wdb2');
@define('MODULE_SHIPPING_FEDEX_WEB_SERVICES_PWD', 'u4hXPKKcpKBw9RQ4n1hBvsJAH');
@define('MODULE_SHIPPING_FEDEX_WEB_SERVICES_INSURE', 0);
$this->code = "fedexwebservices";
$this->title = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TEXT_TITLE;
$this->description = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_FEDEX_WEB_SERVICES_SORT_ORDER;
$this->handling_fee = MODULE_SHIPPING_FEDEX_WEB_SERVICES_HANDLING_FEE;
//$this->icon = DIR_WS_IMAGES . 'fedex-images/fedex.gif';
$this->icon = '';
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATUS == 'true') ? true : false);
}
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','20');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','21');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','22');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','23');
if ($_SESSION['cart']->count_contents() == $chk_cat) {
$this->enabled = false;
}
}
$this->tax_class = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TAX_CLASS;
$this->fedex_key = MODULE_SHIPPING_FEDEX_WEB_SERVICES_KEY;
$this->fedex_pwd = MODULE_SHIPPING_FEDEX_WEB_SERVICES_PWD;
$this->fedex_act_num = MODULE_SHIPPING_FEDEX_WEB_SERVICES_ACT_NUM;
$this->fedex_meter_num = MODULE_SHIPPING_FEDEX_WEB_SERVICES_METER_NUM;
if (defined("SHIPPING_ORIGIN_COUNTRY")) {
if ((int)SHIPPING_ORIGIN_COUNTRY > 0) {
$countries_array = zen_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
$this->country = $countries_array['countries_iso_code_2'];
} else {
$this->country = SHIPPING_ORIGIN_COUNTRY;
}
} else {
$this->country = STORE_ORIGIN_COUNTRY;
}
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE . "' 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 == false) {
$this->enabled = false;
}
}
}
//Class Methods
EDIT:
Also, I just noticed that it does NOT show FedEx when items in the categories 20-23 are added, but if an item from another category is added then it shows FedEx.