PageRenderTime 51ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/includes/modules/shipping/fedexeu.php

https://bitbucket.org/flth/xtcm
PHP | 296 lines | 226 code | 43 blank | 27 comment | 54 complexity | eb606f037b8d82cb05b077ec7fbded4a MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. /* -----------------------------------------------------------------------------------------
  3. $Id: fedexeu.php 899 2005-04-29 02:40:57Z hhgag $
  4. XT-Commerce - community made shopping
  5. http://www.xt-commerce.com
  6. Copyright (c) 2003 XT-Commerce
  7. -----------------------------------------------------------------------------------------
  8. based on:
  9. (c) 2000-2001 The Exchange Project (earlier name of osCommerce)
  10. (c) 2002-2003 osCommerce(fedexeu.php,v 1.01 2003/02/18); www.oscommerce.com
  11. (c) 2003 nextcommerce (fedexeu.php,v 1.12 2003/08/24); www.nextcommerce.org
  12. Released under the GNU General Public License
  13. -----------------------------------------------------------------------------------------
  14. Third Party contributions:
  15. fedex_europe_1.02 Autor: Copyright (C) 2002 - 2003 TheMedia, Dipl.-Ing Thomas Plänkers | http://www.themedia.at & http://www.oscommerce.at
  16. Released under the GNU General Public License
  17. ---------------------------------------------------------------------------------------*/
  18. class fedexeu {
  19. var $code, $title, $description, $icon, $enabled, $num_fedexeu, $types;
  20. function fedexeu() {
  21. global $order;
  22. $this->code = 'fedexeu';
  23. $this->title = MODULE_SHIPPING_FEDEXEU_TEXT_TITLE;
  24. $this->description = MODULE_SHIPPING_FEDEXEU_TEXT_DESCRIPTION;
  25. $this->sort_order = MODULE_SHIPPING_FEDEXEU_SORT_ORDER;
  26. $this->icon = DIR_WS_ICONS . 'shipping_fedexeu.gif';
  27. $this->tax_class = MODULE_SHIPPING_FEDEXEU_TAX_CLASS;
  28. $this->enabled = ((MODULE_SHIPPING_FEDEXEU_STATUS == 'True') ? true : false);
  29. if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FEDEXEU_ZONE > 0) ) {
  30. $check_flag = false;
  31. $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FEDEXEU_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
  32. while ($check = xtc_db_fetch_array($check_query)) {
  33. if ($check['zone_id'] < 1) {
  34. $check_flag = true;
  35. break;
  36. } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
  37. $check_flag = true;
  38. break;
  39. }
  40. }
  41. if ($check_flag == false) {
  42. $this->enabled = false;
  43. }
  44. }
  45. $this->types = array('ENV' => 'FedEx Envelope',
  46. 'PAK' => 'FedEx Pak',
  47. 'BOX' => 'FedEx Box');
  48. /**
  49. * CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
  50. */
  51. $this->num_fedexeu = 8;
  52. }
  53. /**
  54. * class methods
  55. */
  56. function quote($method = '') {
  57. global $order, $shipping_weight, $shipping_num_boxes;
  58. $dest_country = $order->delivery['country']['iso_code_2'];
  59. $dest_zone = 0;
  60. $error = false;
  61. for ($j=1; $j<=$this->num_fedexeu; $j++) {
  62. $countries_table = constant('MODULE_SHIPPING_FEDEXEU_COUNTRIES_' . $j);
  63. $country_zones = explode(",", $countries_table); // Hetfield - 2009-08-18 - replaced deprecated function split with explode to be ready for PHP >= 5.3
  64. if (in_array($dest_country, $country_zones)) {
  65. $dest_zone = $j;
  66. break;
  67. }
  68. }
  69. if ($dest_zone == 0) {
  70. $error = true;
  71. } else {
  72. $shipping = -1;
  73. $fedexeu_cost_env = @constant('MODULE_SHIPPING_FEDEXEU_COST_ENV_' . $j);
  74. $fedexeu_cost_pak = @constant('MODULE_SHIPPING_FEDEXEU_COST_PAK_' . $j);
  75. $fedexeu_cost_box = @constant('MODULE_SHIPPING_FEDEXEU_COST_BOX_' . $j);
  76. $methods = array();
  77. if ($fedexeu_cost_pak != '') {
  78. $fedexeu_table_pak = preg_split("/[:,]/" , $fedexeu_cost_pak); // Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
  79. for ($i=0; $i<sizeof($fedexeu_table_pak); $i+=2) {
  80. if ($shipping_weight <= $fedexeu_table_pak[$i]) {
  81. $shipping_pak = $fedexeu_table_pak[$i+1];
  82. break;
  83. }
  84. }
  85. if ($shipping_pak == -1) {
  86. $shipping_cost = 0;
  87. $shipping_method = MODULE_SHIPPING_FEDEXEU_UNDEFINED_RATE;
  88. } else {
  89. $shipping_cost_1 = ($shipping_pak + MODULE_SHIPPING_FEDEXEU_HANDLING);
  90. }
  91. if ($shipping_pak != 0) {
  92. $methods[] = array('id' => 'PAK',
  93. 'title' => 'FedEx Pak',
  94. 'cost' => (MODULE_SHIPPING_FEDEXEU_HANDLING + $shipping_cost_1) * $shipping_num_boxes);
  95. }
  96. }
  97. if ($fedexeu_cost_env != '') {
  98. $fedexeu_table_env = preg_split("/[:,]/" , $fedexeu_cost_env); // Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
  99. for ($i=0; $i<sizeof($fedexeu_table_env); $i+=2) {
  100. if ($shipping_weight <= $fedexeu_table_env[$i]) {
  101. $shipping_env = $fedexeu_table_env[$i+1];
  102. break;
  103. }
  104. }
  105. if ($shipping_env == -1) {
  106. $shipping_cost = 0;
  107. $shipping_method = MODULE_SHIPPING_FEDEXEU_UNDEFINED_RATE;
  108. } else {
  109. $shipping_cost_1 = ($shipping_env + MODULE_SHIPPING_FEDEXEU_HANDLING);
  110. }
  111. if ($shipping_env != 0) {
  112. $methods[] = array('id' => 'ENV',
  113. 'title' => 'FedEx Envelope',
  114. 'cost' => (MODULE_SHIPPING_FEDEXEU_HANDLING + $shipping_cost_1) * $shipping_num_boxes);
  115. }
  116. }
  117. if ($fedexeu_cost_box != '') {
  118. $fedexeu_table_box = preg_split("/[:,]/" , $fedexeu_cost_box); // Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
  119. if ( ($shipping_weight > 10) and ($shipping_weight <= 20) ) {
  120. $shipping_box = number_format((($shipping_weight - 10)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_' .$j) + $fedexeu_table_box[count ($fedexeu_table_box)-1];
  121. } elseif ( ($shipping_weight > 20) and ($shipping_weight <= 40) ) {
  122. $shipping_box = number_format((($shipping_weight - 20)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_' .$j) + 20 * constant('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_' .$j) + $fedexeu_table_box[count ($fedexeu_table_box)-1];
  123. } elseif ( ($shipping_weight > 40) and ($shipping_weight <= 70) ) {
  124. $shipping_box = number_format((($shipping_weight - 40)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_' .$j) + 20 * constant('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_' .$j) + 40 * constant('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_' .$j) + $fedexeu_table_box[count ($fedexeu_table_box)-1];
  125. } else {
  126. for ($i=0; $i<sizeof($fedexeu_table_box); $i+=2) {
  127. if ($shipping_weight <= $fedexeu_table_box[$i]) {
  128. $shipping_box = $fedexeu_table_box[$i+1];
  129. break;
  130. }
  131. }
  132. }
  133. if ($shipping_box == -1) {
  134. $shipping_cost = 0;
  135. $shipping_method = MODULE_SHIPPING_FEDEXEU_UNDEFINED_RATE;
  136. } else {
  137. $shipping_cost_2 = ($shipping_box + MODULE_SHIPPING_FEDEXEU_HANDLING);
  138. }
  139. if ($shipping_box != 0) {
  140. $methods[] = array('id' => 'BOX',
  141. 'title' => 'FedEx Box',
  142. 'cost' => (MODULE_SHIPPING_FEDEXEU_HANDLING + $shipping_cost_2) * $shipping_num_boxes);
  143. }
  144. }
  145. }
  146. $this->quotes = array('id' => $this->code,
  147. 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . ' ' . MODULE_SHIPPING_FEDEXEU_TEXT_UNITS .')');
  148. $this->quotes['methods'] = $methods;
  149. if ($this->tax_class > 0) {
  150. $this->quotes['tax'] = xtc_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
  151. }
  152. if (xtc_not_null($this->icon)) $this->quotes['icon'] = xtc_image($this->icon, $this->title);
  153. if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_FEDEXEU_INVALID_ZONE;
  154. if ( (xtc_not_null($method)) && (isset($this->types[$method])) ) {
  155. for ($i=0; $i<sizeof($methods); $i++) {
  156. if ($method == $methods[$i]['id']) {
  157. $methodsc = array();
  158. $methodsc[] = array('id' => $methods[$i]['id'],
  159. 'title' => $methods[$i]['title'],
  160. 'cost' => $methods[$i]['cost']);
  161. break;
  162. }
  163. }
  164. $this->quotes['methods'] = $methodsc;
  165. }
  166. return $this->quotes;
  167. }
  168. function check() {
  169. if (!isset($this->_check)) {
  170. $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FEDEXEU_STATUS'");
  171. $this->_check = xtc_db_num_rows($check_query);
  172. }
  173. return $this->_check;
  174. }
  175. function install() {
  176. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_SHIPPING_FEDEXEU_STATUS', 'True', '6', '0', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");
  177. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_HANDLING', '0', '6', '0', now())");
  178. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, use_function, set_function, date_added) values ('MODULE_SHIPPING_FEDEXEU_TAX_CLASS', '0', '6', '0', 'xtc_get_tax_class_title', 'xtc_cfg_pull_down_tax_classes(', now())");
  179. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, use_function, set_function, date_added) values ('MODULE_SHIPPING_FEDEXEU_ZONE', '0', '6', '0', 'xtc_get_zone_class_title', 'xtc_cfg_pull_down_zone_classes(', now())");
  180. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_SORT_ORDER', '0', '6', '0', now())");
  181. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_ALLOWED', '', '6', '0', now())");
  182. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_1', 'AT,AD,BE,DK,DE,FI,FO,FR,GR,GL,GB,IE,IT,LU,MC,NL,PT,SE,SM,ES,VA', '6', '0', now())");
  183. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_1', '0.5:41.40,1:48.20,1.5:51.30,2:54.40,2.5:57.50', '6', '0', now())");
  184. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_1', '0.5:41.40,1:48.20,1.5:51.30,2:54.40,2.5:57.50,3:60.30,3.5:63.00,4:65.70,4.5:68.50,5:71.20,5.5:75.20,6:77.80,6.5:80.30,7:82.90,7.5:85.50,8:88.10,8.5:90.60,9:93.20,9.5:95.80,10:98.40', '6', '0', now())");
  185. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_1', '1.70', '6', '0', now())");
  186. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_1', '1.30', '6', '0', now())");
  187. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_1', '1.10', '6', '0', now())");
  188. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_2', 'GI,IS,LI,NO,CH', '6', '0', now())");
  189. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_2', '0.5:51.90,1:58.20,1.5:64.40,2:70.70,2.5:77.00', '6', '0', now())");
  190. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_2', '0.5:71.50,1:77.80,1.5:84.20,2:90.40,2.5:96.70,3:103.10,3.5:108.50,4:113.90,4.5:119.40,5:124.80,5.5:129.50,6:134.30,6.5:139.10,7:143.80,7.5:148.50,8:153.30,8.5:158.00,9:162.80,9.5:167.60,10:172.40', '6', '0', now())");
  191. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_2', '1.50', '6', '0', now())");
  192. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_2', '1.50', '6', '0', now())");
  193. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_2', '1.60', '6', '0', now())");
  194. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_3', 'AL,BA,BG,EE,HR,LV,LT,MK,MD,PL,RO,RU,SK,SI,CZ,TR,UA,HU,YU,BY', '6', '0', now())");
  195. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_3', '0.5:51.10,1:57.60,1.5:64.20,2:70.70,2.5:77.30', '6', '0', now())");
  196. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_3', '0.5:70.70,1:79.80,1.5:86.20,2:92.70,2.5:99.10,3:104.50,3.5:109.90,4:115.20,4.5:120.60,5:126.00,5.5:130.70,6:135.30,6.5:140.00,7:144.60,7.5:149.20,8:153.90,8.5:158.50,9:163.20,9.5:167.90,10:172.40', '6', '0', now())");
  197. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_3', '2.10', '6', '0', now())");
  198. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_3', '1.40', '6', '0', now())");
  199. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_3', '1.70', '6', '0', now())");
  200. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_4', 'CA,MX,PR,US', '6', '0', now())");
  201. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_4', '0.5:50.30,1:58.30,1.5:66.10,2:74.10,2.5:81.90', '6', '0', now())");
  202. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_4', '0.5:70.90,1:78.10,1.5:86.00,2:93.80,2.5:101.70,3:109.50,3.5:117.30,4:125.20,4.5:133.10,5:141.00,5.5:148.80,6:156.70,6.5:164.50,7:172.40,7.5:180.20,8:187.10,8.5:194.90,9:202.80,9.5:210.60,10:218.40', '6', '0', now())");
  203. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_4', '4.10', '6', '0', now())");
  204. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_4', '3.90', '6', '0', now())");
  205. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_4', '3.80', '6', '0', now())");
  206. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_5', 'AU,CN,HK,ID,JP,KR,MO,MY,NZ,PH,SG,TW,TH,VN', '6', '0', now())");
  207. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_5', '0.5:55.80,1:74.60,1.5:93.20,2:111.90,2.5:130.40', '6', '0', now())");
  208. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_5', '0.5:72.90,1:91.50,1.5:110.10,2:128.80,2.5:147.40,3:164.60,3.5:181.70,4:198.80,4.5:216.00,5:233.10,5.5:242.40,6:251.80,6.5:261.10,7:270.40,7.5:279.80,8:289.10,8.5:298.40,9:307.60,9.5:317.00,10:326.40', '6', '0', now())");
  209. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_5', '4.30', '6', '0', now())");
  210. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_5', '4.30', '6', '0', now())");
  211. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_5', '3.70', '6', '0', now())");
  212. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_6', 'BH,BD,BT,BN,KH,CY,EG,IN,IL,YE,JO,QA,KW,LA,LB,MT,MM,NP,OM,PK,SA,LK,SY,AE', '6', '0', now())");
  213. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_6', '0.5:59.60,1:79.00,1.5:96.70,2:114.40,2.5:132.20', '6', '0', now())");
  214. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_6', '0.5:81.20,1:100.50,1.5:118.30,2:136.10,2.5:153.90,3:171.70,3.5:189.50,4:207.30,4.5:225.10,5:242.70,5.5:251.70,6:260.70,6.5:269.70,7:278.50,7.5:287.40,8:296.30,8.5:305.10,9:314.10,9.5:322.90,10:331.90', '6', '0', now())");
  215. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_6', '4.50', '6', '0', now())");
  216. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_6', '4.30', '6', '0', now())");
  217. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_6', '3.80', '6', '0', now())");
  218. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_7', 'AI,AG,AR,AW,BS,BB,BZ,BM,BO,BR,KY,CL,CR,CO,DM,DO,EC,SV,GF,GD,GP,GT,GY,HT,HN,JM,VG,VI,MQ,MS,NI,AN,PA,PY,PE,KN,LC,VC,ZA,SR,TT,TC,UY,VE', '6', '0', now())");
  219. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_7', '0.5:67.00,1:85.60,1.5:104.30,2:122.90,2.5:114.50', '6', '0', now())");
  220. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_7', '0.5:84.20,1:102.80,1.5:121.40,2:140.00,2.5:158.70,3:175.70,3.5:192.90,4:210.10,4.5:227.20,5:244.30,5.5:254.40,6:264.50,6.5:274.50,7:284.60,7.5:294.60,8:304.60,8.5:314.70,9:324.80,9.5:334.90,10:344.90', '6', '0', now())");
  221. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_7', '4.50', '6', '0', now())");
  222. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_7', '4.30', '6', '0', now())");
  223. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_7', '4.30', '6', '0', now())");
  224. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COUNTRIES_8', 'DZ,AS,AO,AM,AZ,BJ,BW,BF,BI,CM,CV,TD,CK,CG,DJ,GQ,ET,ER,FJ,FM,PF,GA,GM,GN,GW,GE,GH,GU,KZ,KE,KG,LS,LR,MG,MW,MV,ML,MA,MR,MU,MN,MZ,NA,NC,NE,NG,PW,PG,RE,RW,ZM,ZW,SN,SC,SL,SD,SZ,TZ,TG,TN,TM,UG,UZ,VU,WF', '6', '0', now())");
  225. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_PAK_8', '0.5:68.50,1:86.90,1.5:105.50,2:124.00,2.5:142.40', '6', '0', now())");
  226. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_COST_BOX_8', '0.5:88.60,1:107.10,1.5:125.60,2:144.10,2.5:162.40,3:179.50,3.5:196.50,4:213.40,4.5:230.50,5:247.40,5.5:257.30,6:267.30,6.5:277.30,7:287.20,7.5:297.20,8:307.20,8.5:317.20,9:327.20,9.5:337.20,10:347.20', '6', '0', now())");
  227. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_8', '5.50', '6', '0', now())");
  228. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_8', '4.70', '6', '0', now())");
  229. xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_8', '4.70', '6', '0', now())");
  230. }
  231. function remove() {
  232. xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
  233. }
  234. function keys() {
  235. $keys = array('MODULE_SHIPPING_FEDEXEU_STATUS', 'MODULE_SHIPPING_FEDEXEU_HANDLING','MODULE_SHIPPING_FEDEXEU_ALLOWED', 'MODULE_SHIPPING_FEDEXEU_TAX_CLASS', 'MODULE_SHIPPING_FEDEXEU_ZONE', 'MODULE_SHIPPING_FEDEXEU_SORT_ORDER');
  236. for ($i = 1; $i <= $this->num_fedexeu; $i ++) {
  237. $keys[count($keys)] = 'MODULE_SHIPPING_FEDEXEU_COUNTRIES_' . $i;
  238. $keys[count($keys)] = 'MODULE_SHIPPING_FEDEXEU_COST_PAK_' . $i;
  239. $keys[count($keys)] = 'MODULE_SHIPPING_FEDEXEU_COST_ENV_' . $i;
  240. $keys[count($keys)] = 'MODULE_SHIPPING_FEDEXEU_COST_BOX_' . $i;
  241. $keys[count($keys)] = 'MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_' . $i;
  242. $keys[count($keys)] = 'MODULE_SHIPPING_FEDEXEU_STEP_BOX_40_' . $i;
  243. $keys[count($keys)] = 'MODULE_SHIPPING_FEDEXEU_STEP_BOX_70_' . $i;
  244. }
  245. return $keys;
  246. }
  247. }
  248. ?>