Hi
I 've added a new modue for French Shipping: Colissimo MVS
I m trying to build the International Version...
I need some help.
My Install function (at the end of the module) have to be like this:
function install($vendors_id='1') {
$vID = $vendors_id;
//multi vendor add 'vendors_id' to field names and '" . $vID . "', to values
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values ('Activer Colissimo international', 'MODULE_SHIPPING_INTERNATIONAL_STATUS_" . $vendors_id . "', 'True', 'Vous souhaitez activer l\'expédition via colissimo international? (0=non, 1=oui)', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 1 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_1_" . $vendors_id . "', 'DE,BE,NL', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 1 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_1_" . $vendors_id . "', '1:11.00,2:11.50,3:12.00,4:12.50,5:13.00,6:13.50,7:14.00,8:14.50,9:15.00,10:15.50,15:18.00,20:20.50,25:23.00,30:25.50', 'Tarifs Colissimo international pour les destinations de la Zone 1. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 2 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_2_" . $vendors_id . "', 'GB,IT,ES', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 2 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_2_" . $vendors_id . "', '1:13.30,2:13.90,3:14.50,4:12.50,5:13.00,6:13.50,7:14.00,8:14.50,9:15.00,10:15.50,15:18.00,20:20.50,25:23.00,30:25.50', 'Tarifs Colissimo international pour les destinations de la Zone 2. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 3 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_3_" . $vendors_id . "', 'AT,DK,IE,PT', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 3 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_3_" . $vendors_id . "', '1:13.70,2:14.80,3:15.90,4:17.00,5:18.10,6:19.20,7:20.30,8:21.40,9:22.50,10:23.60,15:29.10,20:34.60,25:40.10,30:45.60', 'Tarifs Colissimo international pour les destinations de la Zone 3. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 4 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_4_" . $vendors_id . "', 'FI,NO,SE,CH', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 4 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_4_" . $vendors_id . "', '1:17.70,2:18.70,3:19.70,4:20.70,5:21.70,6:22.70,7:23.70,8:24.70,9:25.70,10:26.70,15:31.70,20:36.70,25:41.70,30:46.70', 'Tarifs Colissimo international pour les destinations de la Zone 4. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 5 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_5_" . $vendors_id . "', 'GR,IS,PL', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 5 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_5_" . $vendors_id . "', '1:18.00,2:21.30,3:24.60,4:27.90,5:31.20,6:34.50,7:37.80,8:41.10,9:44.40,10:47.70,15:59.70,20:71.70,25:83.70,30:95.70', 'Tarifs Colissimo international pour les destinations de la Zone 5. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 6 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_6_" . $vendors_id . "', 'US,CA', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 6 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_6_" . $vendors_id . "', '1:22.00,2:29.00,3:36.00,4:43.00,5:50.00,6:57.00,7:64.00,8:71.00,9:78.00,10:85.00,15:110.00,20:135.00,25:160.00,30:185.00', 'Tarifs Colissimo international pour les destinations de la Zone 6. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Shipping Zone', 'MODULE_SHIPPING_INTERNATIONAL_ZONE_" . $vendors_id . "', '0', 'If a zone is selected, only enable Store Pickup for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Frais d\'emballage', 'MODULE_SHIPPING_INTERNATIONAL_HANDLING_" . $vendors_id . "', '0', 'Définir le cout fixe d\'emballage', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Code TVA', 'MODULE_SHIPPING_INTERNATIONAL_TAX_CLASS_" . $vendors_id . "', '0', 'Choisir le code TVA en fonction du taux', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Ordre de tri', 'MODULE_SHIPPING_INTERNATIONAL_SORT_ORDER_" . $vendors_id . "', '0', 'Définir l\'ordre d\'affichage', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Descriptif au choix', 'MODULE_SHIPPING_INTERNATIONAL_SHIP_TEXT_" . $vendors_id . "', 'Vous recevrez par mail votre numéro de suivi de colis', 'Le client pourra voir ce descriptif', '6', '0', now(), '" . $vendors_id . "')");
}
In order to have those lines... I get a code in my key function:
function keys($vendors_id) {
return array('MODULE_SHIPPING_INTERNATIONAL_STATUS_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_' . $i . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_COST_' . $i . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_ZONE_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_HANDLING_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_TAX_CLASS_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_STORE_POSTCODE_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_SORT_ORDER_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_SHIP_TEXT_' . $vendors_id);
It doesn't work like this... I don't have any table in my Vendor Manager
it appears to be this:
. $i .
Where should it be placed to get the rights numbers...?
Then i'm trying to split table in my main function:
$dest_country = $order->delivery['country']['iso_code_2'];
$error = false;
for ($i = 1; $i <= $this->num_international; $i ++) {
$countries_tables = constant('MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_' . $i . $vendors_id);
$country = split("[,]", $countries_tables);
if ( in_array($dest_country, $country ) ) {
$dest_zone = $i;
break;
}
}
if ($dest_country == 0) {
$this->quotes['error'] = MODULE_SHIPPING_INTERNATIONAL_INVALID_ZONE;
}
$international_cost = constant('MODULE_SHIPPING_INTERNATIONAL_COST_' . $vendors_id);
// International MVS End
$international_table = split("[:,]" , $international_cost . $dest_zones);
$shipping = -1;
$size = sizeof($international_table);
for ($i=0; $i<$size; $i+=2) {
if ($shipping_weight <= $international_table[$i]) {
$shipping = $international_table[$i+1];
$shipping_method = MODULE_SHIPPING_INTERNATIONAL_TEXT_WAY . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_INTERNATIONAL_TEXT_UNITS;
//MVS Start
$vendors_data_query = tep_db_query("select handling_charge
from " . TABLE_VENDORS . "
where vendors_id = '" . (int)$vendors_id . "'"
);
$vendors_data = tep_db_fetch_array($vendors_data_query);
//Set handling to the handling per box times number of boxes, or handling charge if it is larger
$handling = $vendors_data['handling_charge'];
//Set handling to the module's handling charge if it is larger
$module_handling = constant('MODULE_SHIPPING_INTERNATIONAL_HANDLING_' . $vendors_id);
if ($module_handling > $handling) {
$handling = $module_handling;
}
}
$shipping_cost = $shipping + $handling;
//MVS End
}
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_INTERNATIONAL_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_method,
'cost' => $shipping_cost)));
So, I can't split correctly if i don't have the good keys.
Maybe Jim could help me, or anyone else.
At the end, in order to check a simple syntax error, i let you see the complet code source:
<?php
/*
$Id: international.php,v 1.0 05/02/2008 12:00:00 damdamletouffu $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2008 osCommerce MS2.2
Released under the GNU General Public License
Premiere version pour Multi Vendor Shipping 1.1
*/
class international {
var $code, $title, $description, $enabled, $icon, $vendors_id; //multi vendor
// class constructor
function international() {
//MVS
$this->vendors_id = ($products['vendors_id'] <= 0) ? 1 : $products['vendors_id'];
$this->code = 'international';
$this->description = MODULE_SHIPPING_INTERNATIONAL_TEXT_DESCRIPTION;
$this->title = MODULE_SHIPPING_INTERNATIONAL_TEXT_TITLE;
$this->description = MODULE_SHIPPING_INTERNATIONAL_TEXT_DESCRIPTION;
$this->icon = DIR_WS_ICONS . 'international.gif'; // ou shipping_laposte.gif au choix
// CUSTOMIZE THIS SETTING FOR THE NUMBER OF international NEEDED
$this->num_international = 6; //NBen je remplace 1 par 10
}
//MVS Start
function zones($vendors_id='1') {
if ( ($this->enabled == true) && ((int)constant('MODULE_SHIPPING_INTERNATIONAL_ZONE_' . $vendors_id) > 0) ) {
$check_flag = false;
$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)constant('MODULE_SHIPPING_INTERNATIONAL_ZONE_' . $vendors_id) . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while ($check = tep_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
} //if
}//while
if ($check_flag == false) {
$this->enabled = false;
}//if
}//if
return $this->enabled;
}//function
function sort_order($vendors_id='1') {
$sort_order = @constant ('MODULE_SHIPPING_INTERNATIONAL_SORT_ORDER_' . $vendors_id);
if (isset ($sort_order)) {
$this->sort_order = $sort_order;
} else {
$this->sort_order = '-';
}
return $this->sort_order;
}
function tax_class($vendors_id='1') {
$this->tax_class = constant('MODULE_SHIPPING_INTERNATIONAL_TAX_CLASS_' . $vendors_id);
return $this->tax_class;
}
function enabled($vendors_id='1') {
$this->enabled = false;
$status = @constant('MODULE_SHIPPING_INTERNATIONAL_STATUS_' . $vendors_id);
if (isset ($status) && $status != '') {
$this->enabled = (($status == 'True') ? true : false);
}
return $this->enabled;
}
//Set the number of zones used for this vendor
function num_zones($vendors_id='1') {
$vendors_data_query = tep_db_query("select zones
from " . TABLE_VENDORS . "
where vendors_id = '" . (int)$vendors_id . "'"
);
$vendors_data = tep_db_fetch_array($vendors_data_query);
$this->num_zones = $vendors_data['international'];
return $this->num_zones;
}
//MVS End
//Get a quote
function quote($method = '', $module = '', $vendors_id = '1') {
global $order, $cart, $shipping_weight, $shipping_num_boxes;
//MVS Start
//return an error if the module is not enabled for this vendor
if ($this->enabled($vendors_id) < 1) {
$this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;
return $this->quotes;
}
//MVS End
$dest_country = $order->delivery['country']['iso_code_2'];
$error = false;
for ($i = 1; $i <= $this->num_international; $i ++) {
$countries_tables = constant('MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_' . $i . $vendors_id);
$country = split("[,]", $countries_tables);
if ( in_array($dest_country, $country ) ) {
$dest_zone = $i;
break;
}
}
if ($dest_country == 0) {
$this->quotes['error'] = MODULE_SHIPPING_INTERNATIONAL_INVALID_ZONE;
}
$international_cost = constant('MODULE_SHIPPING_INTERNATIONAL_COST_' . $vendors_id);
// International MVS End
$international_table = split("[:,]" , $international_cost . $dest_zones);
$shipping = -1;
$size = sizeof($international_table);
for ($i=0; $i<$size; $i+=2) {
if ($shipping_weight <= $international_table[$i]) {
$shipping = $international_table[$i+1];
$shipping_method = MODULE_SHIPPING_INTERNATIONAL_TEXT_WAY . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_INTERNATIONAL_TEXT_UNITS;
//MVS Start
$vendors_data_query = tep_db_query("select handling_charge
from " . TABLE_VENDORS . "
where vendors_id = '" . (int)$vendors_id . "'"
);
$vendors_data = tep_db_fetch_array($vendors_data_query);
//Set handling to the handling per box times number of boxes, or handling charge if it is larger
$handling = $vendors_data['handling_charge'];
//Set handling to the module's handling charge if it is larger
$module_handling = constant('MODULE_SHIPPING_INTERNATIONAL_HANDLING_' . $vendors_id);
if ($module_handling > $handling) {
$handling = $module_handling;
}
}
$shipping_cost = $shipping + $handling;
//MVS End
}
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_INTERNATIONAL_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_method,
'cost' => $shipping_cost)));
if ($shipping = 0) {
$shipping_cost = 350000;
return $this->quotes;
}
// Pas possible de livrer
if ($shipping_weight > 30) {
$this->quotes['error'] = MODULE_SHIPPING_INTERNATIONAL_TOO_HEAVY;
return $this->quotes;
}
//$this->tax_class = constant('MODULE_SHIPPING_INTERNATIONAL_TAX_CLASS_' . $vendors_id);
if ($this->tax_class($vendors_id) > 0) {
$this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_INTERNATIONAL_INVALID_ZONE;
return $this->quotes;
}
function check($vendors_id='1') {
if (!isset($this->_check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key = 'MODULE_SHIPPING_INTERNATIONAL_STATUS_" . $vendors_id . "'");
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}
function install($vendors_id='1') {
$vID = $vendors_id;
//multi vendor add 'vendors_id' to field names and '" . $vID . "', to values
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values ('Activer Colissimo international', 'MODULE_SHIPPING_INTERNATIONAL_STATUS_" . $vendors_id . "', 'True', 'Vous souhaitez activer l\'expédition via colissimo international? (0=non, 1=oui)', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 1 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_1_" . $vendors_id . "', 'DE,BE,NL', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 1 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_1_" . $vendors_id . "', '1:11.00,2:11.50,3:12.00,4:12.50,5:13.00,6:13.50,7:14.00,8:14.50,9:15.00,10:15.50,15:18.00,20:20.50,25:23.00,30:25.50', 'Tarifs Colissimo international pour les destinations de la Zone 1. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 2 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_2_" . $vendors_id . "', 'GB,IT,ES', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 2 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_2_" . $vendors_id . "', '1:13.30,2:13.90,3:14.50,4:12.50,5:13.00,6:13.50,7:14.00,8:14.50,9:15.00,10:15.50,15:18.00,20:20.50,25:23.00,30:25.50', 'Tarifs Colissimo international pour les destinations de la Zone 2. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 3 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_3_" . $vendors_id . "', 'AT,DK,IE,PT', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 3 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_3_" . $vendors_id . "', '1:13.70,2:14.80,3:15.90,4:17.00,5:18.10,6:19.20,7:20.30,8:21.40,9:22.50,10:23.60,15:29.10,20:34.60,25:40.10,30:45.60', 'Tarifs Colissimo international pour les destinations de la Zone 3. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 4 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_4_" . $vendors_id . "', 'FI,NO,SE,CH', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 4 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_4_" . $vendors_id . "', '1:17.70,2:18.70,3:19.70,4:20.70,5:21.70,6:22.70,7:23.70,8:24.70,9:25.70,10:26.70,15:31.70,20:36.70,25:41.70,30:46.70', 'Tarifs Colissimo international pour les destinations de la Zone 4. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 5 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_5_" . $vendors_id . "', 'GR,IS,PL', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 5 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_5_" . $vendors_id . "', '1:18.00,2:21.30,3:24.60,4:27.90,5:31.20,6:34.50,7:37.80,8:41.10,9:44.40,10:47.70,15:59.70,20:71.70,25:83.70,30:95.70', 'Tarifs Colissimo international pour les destinations de la Zone 5. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 6 (pays)', 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_6_" . $vendors_id . "', 'US,CA', 'Insérer une virgule entre 2 codes ISO de pays qui font partie de la même zone', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('INTERNATIONAL Zone 6 (poids:tarifs)', 'MODULE_SHIPPING_INTERNATIONAL_COST_6_" . $vendors_id . "', '1:22.00,2:29.00,3:36.00,4:43.00,5:50.00,6:57.00,7:64.00,8:71.00,9:78.00,10:85.00,15:110.00,20:135.00,25:160.00,30:185.00', 'Tarifs Colissimo international pour les destinations de la Zone 6. ', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Shipping Zone', 'MODULE_SHIPPING_INTERNATIONAL_ZONE_" . $vendors_id . "', '0', 'If a zone is selected, only enable Store Pickup for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Frais d\'emballage', 'MODULE_SHIPPING_INTERNATIONAL_HANDLING_" . $vendors_id . "', '0', 'Définir le cout fixe d\'emballage', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Code TVA', 'MODULE_SHIPPING_INTERNATIONAL_TAX_CLASS_" . $vendors_id . "', '0', 'Choisir le code TVA en fonction du taux', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Ordre de tri', 'MODULE_SHIPPING_INTERNATIONAL_SORT_ORDER_" . $vendors_id . "', '0', 'Définir l\'ordre d\'affichage', '6', '0', now(), '" . $vendors_id . "')");
tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Descriptif au choix', 'MODULE_SHIPPING_INTERNATIONAL_SHIP_TEXT_" . $vendors_id . "', 'Vous recevrez par mail votre numéro de suivi de colis', 'Le client pourra voir ce descriptif', '6', '0', now(), '" . $vendors_id . "')");
}
function remove($vendors_id) {
tep_db_query("delete from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key in ('" . implode("', '", $this->keys($vendors_id)) . "')");
}
function keys($vendors_id) {
return array('MODULE_SHIPPING_INTERNATIONAL_STATUS_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_COUNTRIES_' . $i . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_COST_' . $i . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_ZONE_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_HANDLING_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_TAX_CLASS_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_STORE_POSTCODE_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_SORT_ORDER_' . $vendors_id, 'MODULE_SHIPPING_INTERNATIONAL_SHIP_TEXT_' . $vendors_id);
//MVS End
}
}
?>
Thanks
Damien