????
| Current Path : /home2/morganrand/www/store/includes/modules/shipping/ |
| Current File : /home2/morganrand/www/store/includes/modules/shipping/wandership.php |
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Copyright (c) 2012 Club osCommerce [ www.clubosc.com ]
Released under the GNU General Public License
*/
class wandership {
var $code, $title, $description, $icon, $enabled;
// class constructor
function wandership() {
global $order;
$this->code = 'wandership';
$this->title = MODULE_SHIPPING_WANDERSHIP_TEXT_TITLE;
$this->description = MODULE_SHIPPING_WANDERSHIP_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_WANDERSHIP_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_WANDERSHIP_TAX_CLASS;
$this->enabled = ((MODULE_SHIPPING_WANDERSHIP_STATUS == 'True') ? true : false);
}
// class methods
function quote($method = '') {
global $order;
global $currencies, $cart;
$result = null;
$title_UPS_ground = 'UPS Ground';
$title_UPS_Next_Day_Air = 'UPS Next Day Air';
$title_UPS_2nd_Day_Air = 'UPS Second Day Air';
$title_UPS_3_Day_Select = 'UPS 3 Day Select';
$title_USPS_priority = 'USPS Priority Mail';
$title_shipping_error = 'Shipping Error';
if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) {
$dest_zip = str_replace(' ', '', $order->delivery['postcode']);
if ($order->delivery['country']['iso_code_2'] == 'US') {
$dest_zip = substr($dest_zip, 0, 5);
$dest_zip3 = substr($dest_zip, 0, 3);
$result = dest_zip;
$postcode = $dest_zip;
$cost = $dest_zip3;
$shipping_courier = "UPS";
$shipping_postcode = dest_zip;
$shipping_fuel_surcharge = MODULE_SHIPPING_WANDERSHIP_FUEL_SURCHARGE;
$shipping_markup = MODULE_SHIPPING_WANDERSHIP_MARKUP_FACTOR;
$shipping_cost_factor = $shipping_fuel_surcharge * $shipping_markup;
$shipping_flat_addition = MODULE_SHIPPING_WANDERSHIP_FLAT_ADDITION;
$ground_2 = MODULE_SHIPPING_WANDERSHIP_ZONE2_FACTOR;
$ground_3 = MODULE_SHIPPING_WANDERSHIP_ZONE3_FACTOR;
$ground_4 = MODULE_SHIPPING_WANDERSHIP_ZONE4_FACTOR;
$ground_5 = MODULE_SHIPPING_WANDERSHIP_ZONE5_FACTOR;
$ground_6 = MODULE_SHIPPING_WANDERSHIP_ZONE6_FACTOR;
$ground_7 = MODULE_SHIPPING_WANDERSHIP_ZONE7_FACTOR;
$ground_8 = MODULE_SHIPPING_WANDERSHIP_ZONE8_FACTOR;
$number_of_items = $this->getNumberOfItems();
$dimensional_weight = ceil($number_of_items/2.5*16.5 -0.1);
// Get UPS weight rates for all zones
if ($dimensional_weight > 150) {
$rates = tep_db_query("select * from " . TABLE_SHIPPING_UPS_WEIGHT . " where weight = '151'");
$rates = tep_db_fetch_array($rates);
// UPS gives per pound rates after 150 pounds
$shipping_cost_factor = $shipping_cost_factor * $dimensional_weight;
} else {
$rates = tep_db_query("select * from " . TABLE_SHIPPING_UPS_WEIGHT . " where weight = '" . (int)$dimensional_weight . "'");
$rates = tep_db_fetch_array($rates);
}
//
$this->quotes = array('id' => $this->code,'module' => MODULE_SHIPPING_WANDERSHIP_TEXT_TITLE);
$methods = array();
//
// Get UPS zones for a zipcode
// 24 - hawai; 26 - alaska; - air only
if (strpos('X96701X96706X96707X96709X96712X96717X96730X96731X96734X96744X96759X96762X96782X96786XX96789XX96791XX96792XX96795XX96797XX96801XX96802XX96803XX96804XX96805XX96806XX96807XX96808XX96809XX96810XX96811XX96812X96813X96814X96815X96816X96817X96818X96819X96820X96821X96822X96823X96824X96825X96826X96827X96828XX96830XX96835XX96836XX96837XX96838XX96839XX96840XX96841XX96842XX96843XX96844XX96845XX96846XX96847XX96848XX96849X96850X96853X96854X96857X96858X96859X96860X96861X96862X96863X96898',$dest_zip) > 0) {
//24
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_224']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_124']*$shipping_cost_factor + $shipping_flat_addition);
} else if (strpos('X96703X96704X96705X96708X96710X96713X96714X96715X96716X96718X96719X96720X96721X96722X96725X96726X96727X96728X96729X96732X96733X96737X96738X96739X96740X96741X96742X96743X96745X96746X96747X96748X96749X96750X96751X96752X96753X96754X96755X96756X96757X96760X96761X96763X96764X96765X96766X96767X96768X96769X96770X96771X96772X96773X96774X96775X96776X96777X96778X96779X96780X96781X96783X96784X96785X96788X96790X96793X96796',$dest_zip) > 0) {
//26
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_226']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_126']*$shipping_cost_factor + $shipping_flat_addition);
} else if (strpos('X99501X99502X99503X99504X99505X99506X99507X99508X99509X99510X99511X99512X99513X99514X99515X99516X99517X99518X99519XX9520X99521X99522X99523X99524X99540X99556X99567X99568X99572X99577X99587X99603X99605X99610X99611X99631X99635X99639X99645X99654X99664X99669X99672X99687X99701X99702X99703X99705X99706X99707X99708X99709X99710X99711X99712X99775',$dest_zip) > 0) {
//24
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_224']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_124']*$shipping_cost_factor + $shipping_flat_addition);
} else if (strpos('X99529X99530X99545X99546X99547X99548X99549X99550X99551X99552X99553X99554X99555X99557X99558X99559X99561X99563X99564X99565X99566X99569X99571X99573X99574X99575X99576X99578X99579X99580X99581X99583X99584X99585X99586X99588X99589X99590X99591X99599X99602X99604X99606X99607X99608X99609X99612X99613X99614X99615X99619X99620X99621X99622X99624X99625X99626X99627X99628X99629X99630X99632X99633X99634X99636X99637X99638X99640X99641X99643X99644X99647X99648X99649X99650X99651X99652X99653X99655X99656X99657X99658X99659X99660X99661X99662X99663X99665X99666X99667X99668X99670X99671X99674X99675X99676X99677X99678X99679X99680X99681X99682X99683X99684X99685X99686X99688X99689X99690X99691X99692X99693X99694X99695X99697X99704X99714X99716X99720X99721X99722X99723X99724X99725X99726X99727X99729X99730X99731X99732X99733X99734X99736X99737X99738X99739X99740X99741X99742X99743X99744X99745X99746X99747X99748X99749X99750X99751X99752X99753X99754X99755X99756X99757X99758X99759X99760X99761X99762X99763X99764X99765X99766X99767X99768X99769X99770X99771X99772X99773X99774X99776X99777X99778X99779X99780X99781X99782X99783X99784X99785X99786X99788X99789X99790X99791X99801X99802X99803X99811X99812X99820X99821X99824X99825X99826X99827X99829X99830X99832X99833X99835X99836X99840X99841X99850X99901X99903X99918X99919X99921X99922X99923X99925X99926X99927X99928X99929X99950',$dest_zip) > 0) {
//26
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_226']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_126']*$shipping_cost_factor + $shipping_flat_addition);
} else {
$UPS_zones = tep_db_query("select * from " . TABLE_SHIPPING_UPS_ZONES . " where zip3_destination = '" . (int)$dest_zip3 . "'");
$UPS_zones = tep_db_fetch_array($UPS_zones);
$UPS_ground = $UPS_zones['zones_ground'];
if ($UPS_ground == 2) {
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_ground, $shipping_postcode, $shipping_courier), 'cost' => ($rates['UPS_ZONE_2']*$shipping_cost_factor + $shipping_flat_addition) * $ground_2);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_3_Day_Select, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_302']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_202']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_102']*$shipping_cost_factor + $shipping_flat_addition);
}
else if ($UPS_ground == 3) {
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_ground, $shipping_postcode, $shipping_courier), 'cost' => ($rates['UPS_ZONE_3']*$shipping_cost_factor + $shipping_flat_addition) * $ground_3);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_3_Day_Select, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_303']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_203']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_103']*$shipping_cost_factor + $shipping_flat_addition);
}
else if ($UPS_ground == 4) {
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_ground, $shipping_postcode, $shipping_courier), 'cost' => ($rates['UPS_ZONE_4']*$shipping_cost_factor + $shipping_flat_addition) * $ground_4);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_3_Day_Select, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_304']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_204']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_104']*$shipping_cost_factor + $shipping_flat_addition);
}
else if ($UPS_ground == 5) {
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_ground, $shipping_postcode, $shipping_courier), 'cost' => ($rates['UPS_ZONE_5']*$shipping_cost_factor + $shipping_flat_addition) * ground_5);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_3_Day_Select, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_305']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_205']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_105']*$shipping_cost_factor + $shipping_flat_addition);
}
else if ($UPS_ground == 6) {
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_ground, $shipping_postcode, $shipping_courier), 'cost' => ($rates['UPS_ZONE_6']*$shipping_cost_factor + $shipping_flat_addition) * $ground_6);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_3_Day_Select, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_306']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_206']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_106']*$shipping_cost_factor + $shipping_flat_addition);
}
else if ($UPS_ground == 7) {
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_ground, $shipping_postcode, $shipping_courier), 'cost' => ($rates['UPS_ZONE_7']*$shipping_cost_factor + $shipping_flat_addition) * $ground_7);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_3_Day_Select, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_307']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_207']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_107']*$shipping_cost_factor + $shipping_flat_addition);
}
else if ($UPS_ground == 8) {
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_ground, $shipping_postcode, $shipping_courier), 'cost' => ($rates['UPS_ZONE_8']*$shipping_cost_factor + $shipping_flat_addition) * $ground_8);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_3_Day_Select, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_308']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_2nd_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_208']*$shipping_cost_factor + $shipping_flat_addition);
$methods[] = array('id' => $this->code, 'title' => sprintf($title_UPS_Next_Day_Air, $shipping_postcode, $shipping_courier), 'cost' => $rates['UPS_ZONE_108']*$shipping_cost_factor + $shipping_flat_addition);
}
else {
$shipping_cost = 10000;
$methods[] = array('id' => $this->code, 'title' => sprintf($title_shipping_error, $shipping_postcode, $shipping_courier), 'cost' => $shipping_cost);
}
}
}
} else if ($order->delivery['country']['iso_code_2'] == 'CA') {
$dest_zip = str_replace(' ', '', $order->delivery['postcode']);
$shipping_postcode = dest_zip;
$shipping_courier = "USPS";
$number_of_items = $this->getNumberOfItems();
$unit_cost_factor = 0.95;
$shipping_cost = 24.0 + $unit_cost_factor * $number_of_items * 10;
$this->quotes = array('id' => $this->code,'module' => MODULE_SHIPPING_WANDERSHIP_TEXT_TITLE);
$methods = array();
$methods[] = array('id' => $this->code, 'title' => sprintf($title_USPS_priority, $shipping_postcode, $shipping_courier), 'cost' => $shipping_cost);
} else {
$shipping_courier = "UPS";
$dest_zip = str_replace(' ', '', $order->delivery['postcode']);
$shipping_postcode = dest_zip;
$shipping_cost = 10000;
$this->quotes = array('id' => $this->code,'module' => MODULE_SHIPPING_WANDERSHIP_TEXT_TITLE);
$methods = array();
$methods[] = array('id' => $this->code, 'title' => sprintf($title_shipping_error, $shipping_postcode, $shipping_courier), 'cost' => $shipping_cost);
}
$this->quotes['methods'] = $methods;
if ($this->tax_class > 0) {
$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
return $this->quotes;
}
function check() {
if (!isset($this->_check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_WANDERSHIP_STATUS'");
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}
function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Wander Shipping', 'MODULE_SHIPPING_WANDERSHIP_STATUS', 'True', 'Do you want to offer Wander rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Fuel Surcharge', 'MODULE_SHIPPING_WANDERSHIP_FUEL_SURCHARGE', '1.10', 'UPS fuel surcharge.', '6', '0', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Markup factor', 'MODULE_SHIPPING_WANDERSHIP_MARKUP_FACTOR', '1.35', 'Wanderfuls markup factor.', '6', '1', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Flat addition', 'MODULE_SHIPPING_WANDERSHIP_FLAT_ADDITION', '12.00', 'Flat addition to all orders ($) applied after fuel surcharge and markup.', '6', '2', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Ground zone 2 factor', 'MODULE_SHIPPING_WANDERSHIP_ZONE2_FACTOR', '1.16', 'UPS zone 2 factor applied to all ground orders in zone 2.', '6', '3', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Ground zone 3 factor', 'MODULE_SHIPPING_WANDERSHIP_ZONE3_FACTOR', '1.08', 'UPS zone 3 factor applied to all ground orders in zone 3.', '6', '4', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Ground zone 4 factor', 'MODULE_SHIPPING_WANDERSHIP_ZONE4_FACTOR', '1.08', 'UPS zone 4 factor applied to all ground orders in zone 4.', '6', '5', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Ground zone 5 factor', 'MODULE_SHIPPING_WANDERSHIP_ZONE5_FACTOR', '1.08', 'UPS zone 5 factor applied to all ground orders in zone 5.', '6', '6', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Ground zone 6 factor', 'MODULE_SHIPPING_WANDERSHIP_ZONE6_FACTOR', '1.00', 'UPS zone 6 factor applied to all ground orders in zone 6.', '6', '7', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Ground zone 7 factor', 'MODULE_SHIPPING_WANDERSHIP_ZONE7_FACTOR', '1.00', 'UPS zone 7 factor applied to all ground orders in zone 7.', '6', '8', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Ground zone 8 factor', 'MODULE_SHIPPING_WANDERSHIP_ZONE8_FACTOR', '1.00', 'UPS zone 8 factor applied to all ground orders in zone 8.', '6', '9', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_WANDERSHIP_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '10', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_WANDERSHIP_SORT_ORDER', '0', 'Sort order of display.', '6', '11', now())");
}
function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_SHIPPING_WANDERSHIP_STATUS', 'MODULE_SHIPPING_WANDERSHIP_FUEL_SURCHARGE', 'MODULE_SHIPPING_WANDERSHIP_MARKUP_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_FLAT_ADDITION', 'MODULE_SHIPPING_WANDERSHIP_ZONE2_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_ZONE3_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_ZONE4_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_ZONE5_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_ZONE6_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_ZONE7_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_ZONE8_FACTOR', 'MODULE_SHIPPING_WANDERSHIP_TAX_CLASS', 'MODULE_SHIPPING_WANDERSHIP_SORT_ORDER');
}
function getNumberOfItems() {
global $order, $total_count;
$number_of_items = $total_count;
/*if ($order->content_type == 'mixed') {
$number_of_items = 0;
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
$number_of_items += $order->products[$i]['qty'];
if (isset($order->products[$i]['attributes'])) {
reset($order->products[$i]['attributes']);
while (list($option, $value) = each($order->products[$i]['attributes'])) {
$virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id");
$virtual_check = tep_db_fetch_array($virtual_check_query);
if ($virtual_check['total'] > 0) {
$number_of_items -= $order->products[$i]['qty'];
}
}
}
}
}*/
return $number_of_items;
}
}
?>