Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

German/Austrian Post Modul mit anderer SQL Tabelle verknüpfen


cybermailer1533005540

Recommended Posts

Hallo,

Ich habe folgendes Problem:

Ich einen Zweitshop von Oscommerce angelegt wobei ich allen Tabellen einen Prefix gegeben habe.

Z.B. heißt das ganze jetzt nicht mehr configuration sondern z.B. shop2_configuration.

Somit kann ich 2 Shops paralles mit nur einer SQL Datenbank laufen lassen.

Ich habe den Shop soweit fertig und auch alle notwendigen Module installiert nur machen mir die Standardmodule der Versandarten Probleme.

Bei denen sind nämlich im Quelltext fixe Tabellennahmen eingegeben und wenn ich die einfach um den Prefix erweitere spinnt überhaupt alles.

Beispiel wie das SCRIPT Für German Parcel bzw. Austrian Parcel ORIGINAL aussieht:

class ap {
var $code, $title, $description, $icon, $enabled, $num_ap;

// class constructor
function ap() {
global $order;

$this->code = 'ap';
$this->title = MODULE_SHIPPING_AP_TEXT_TITLE;
$this->description = MODULE_SHIPPING_AP_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_AP_SORT_ORDER;
$this->icon = DIR_WS_ICONS . 'shipping_ap.gif';
$this->tax_class = MODULE_SHIPPING_AP_TAX_CLASS;
$this->enabled = ((MODULE_SHIPPING_AP_STATUS == 'True') ? true : false);

if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AP_ZONE > 0) ) {
$check_flag = false;
$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AP_ZONE . "' 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 ($check_flag == false) {
$this->enabled = false;
}
}

// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
$this->num_ap = 8;
}

// class methods
function quote($method = '') {
global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes;

$dest_country = $order->delivery['country']['iso_code_2'];
$dest_zone = 0;
$error = false;

for ($i=1; $i<=$this->num_ap; $i++) {
$countries_table = constant('MODULE_SHIPPING_AP_COUNTRIES_' . $i);
$country_zones = split("[,]", $countries_table);
if (in_array($dest_country, $country_zones)) {
$dest_zone = $i;
break;
}
}

if ($dest_zone == 0) {
$error = true;
} else {
$shipping = -1;
$ap_cost = constant('MODULE_SHIPPING_AP_COST_' . $i);
if ($i < $this->num_ap) {

$shipping = MODULE_SHIPPING_AP_BASE + MODULE_SHIPPING_AP_MAUT + ($ap_cost * floor($shipping_weight + 0.99));
$shipping_method = MODULE_SHIPPING_AP_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_AP_TEXT_UNITS;

} else {
$ap_table = split("[:,]" , $ap_cost);
for ($i=0; $i<sizeof($ap_table); $i+=2) {
if ($shipping_weight <= $ap_table[$i]) {
$shipping = $ap_table[$i+1];
$shipping_method = MODULE_SHIPPING_AP_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_AP_TEXT_UNITS;
break;
}
}
}
if ($shipping == -1) {
$shipping_cost = 0;
$shipping_method = MODULE_SHIPPING_AP_UNDEFINED_RATE;
} else {
$shipping_cost = ($shipping + MODULE_SHIPPING_AP_HANDLING);
}
}

$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_AP_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_method . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . ' ' . MODULE_SHIPPING_AP_TEXT_UNITS .')',
'cost' => $shipping_cost * $shipping_num_boxes)));

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);

if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AP_INVALID_ZONE;

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_AP_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 ('Österreichische Post AG', 'MODULE_SHIPPING_AP_STATUS', 'True', 'Wollen Sie den Versand über die Österreichische Post AG anbieten?', '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 ('Handling Fee', 'MODULE_SHIPPING_AP_HANDLING', '0', 'Bearbeitungsgebühr für diese Versandart in Euro', '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 ('Grundpreis', 'MODULE_SHIPPING_AP_BASE', '11.80', 'Grundpreis pro Paket in Euro', '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 ('Maut', 'MODULE_SHIPPING_AP_MAUT', '0.12', 'Mautzuschlag pro Paket in Euro', '6', '0', 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 ('Steuersatz', 'MODULE_SHIPPING_AP_TAX_CLASS', '0', 'Wählen Sie den MwSt.-Satz für diese Versandart aus.', '6', '0', '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, use_function, set_function, date_added) values ('Versand Zone', 'MODULE_SHIPPING_AP_ZONE', '0', 'Wenn Sie eine Zone auswählen, wird diese Versandart nur in dieser Zone angeboten.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_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 ('Reihenfolge der Anzeige', 'MODULE_SHIPPING_AP_SORT_ORDER', '0', 'Niedrigste wird zuerst angezeigt.', '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 ('Zone 1a Länder', 'MODULE_SHIPPING_AP_COUNTRIES_1', 'DE,IT,SM,SK,SI,CZ,HU', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 1a sind.', '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 ('Zone 1a Tarif', 'MODULE_SHIPPING_AP_COST_1', '0.75', 'Tarif pro angefangenem kg Versandgewicht für Zone 1a.', '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 ('Zone 1b Länder', 'MODULE_SHIPPING_AP_COUNTRIES_2', 'AD,BE,CY,DK,FO,GL,EE,FI,FR,GR,GB,IE,LV,LI,LT,LU,MC,MT,NL,PL,PT,SE,CH,ES,VA', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 1b sind.', '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 ('Zone 1b Tarif', 'MODULE_SHIPPING_AP_COST_2', '1', 'Tarif pro angefangenem kg Versandgewicht für Zone 1b.', '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 ('Zone 2 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_3', & #39;EG,AL,DZ,AM,AZ,BA,BG,GE,GI,IS,IL,YU,HR,LV,LB,LY,MA,MK,MD,NO,RO,RU,SY,TN,TR,U
A,BY', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 2 sind.', '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 ('Zone 2 Tarif', 'MODULE_SHIPPING_AP_COST_3', '2', 'Tarif pro angefangenem kg Versandgewicht für Zone 2.', '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 ('Zone 3 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_4', & #39;ET,BH,BJ,BF,CI,DJ,ER,GM,GH,GU,GN,GW,IQ,IR,YE,JO,CM,CA,CV,KZ,QA,KG,KW,LR,ML,M
H,MR,FM,NE,NG,MP,OM,PR,SA,SN,SL,SO,SD,TJ,TG,TD,TM,UZ,AE,US,UM,CF', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 3 sind.', '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 ('Zone 3 Tarif', 'MODULE_SHIPPING_AP_COST_4', '3', 'Tarif pro angefangenem kg Versandgewicht für Zone 3.', '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 ('Zone 4 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_5', & #39;AF,AO,AI,AG,GQ,AR,BS,BD,BB,BZ,BM,BT,BO,BW,BR,BN,BI,KY,CL,CN,CR,DM,DO,EC,SV,F
K,GF,GA,GD,GP,GT,GY,HT,HN,HK,IN,ID,TP,JM,JP,KH,KE,CO,KM,CG,KP,KR,CU,LA,LS', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 4 sind.', '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 ('Zone 4 Tarif', 'MODULE_SHIPPING_AP_COST_5', '4.5', 'Tarif pro angefangenem kg Versandgewicht für Zone 4.', '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 ('Zone 4 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_6', & #39;MO,MG,MW,MY,MV,MQ,MU,MX,MN,MS,MZ,MM,NA,NP,NI,AN,AW,PK,PA,PY,PE,PH,RE,RW,ZM,S
T,SC,ZW,SG,LK,KN,LC,PM,VC,ZA,SR,SZ,TZ,TH,TT,TC,UG,UY,VE,VN,VG', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 4 sind.', '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 ('Zone 4 Tarif', 'MODULE_SHIPPING_AP_COST_6', '4.5', 'Tarif pro angefangenem kg Versandgewicht für Zone 4.', '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 ('Zone 5 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_7', 'AU,CK,FJ,PF,KI,NR,NC,NZ,PG,PN,SB,TO,TV,VU,WF,WS', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 5 sind.', '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 ('Zone 5 Tarif', 'MODULE_SHIPPING_AP_COST_7', '6.5', 'Tarif pro angefangenem kg Versandgewicht für Zone 5.', '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 ('Zone Inland', 'MODULE_SHIPPING_AP_COUNTRIES_8', 'AT', 'Inlandszone', '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 ('Zone Tarif Tabelle bis 31.5 kg', 'MODULE_SHIPPING_AP_COST_8', '2:4.12,4:5.12,8:6.22,12:7.72,20:9.82,31.5:12.92', 'Tarif Tabelle für die Inlandszone, bis 31.5 kg Versandgewicht.', '6', '0', now())");
}

function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
$keys = array('MODULE_SHIPPING_AP_STATUS', 'MODULE_SHIPPING_AP_HANDLING', 'MODULE_SHIPPING_AP_BASE', 'MODULE_SHIPPING_AP_MAUT', 'MODULE_SHIPPING_AP_TAX_CLASS', 'MODULE_SHIPPING_AP_ZONE', 'MODULE_SHIPPING_AP_SORT_ORDER');

for ($i = 1; $i <= $this->num_ap; $i ++) {
$keys[count($keys)] = 'MODULE_SHIPPING_AP_COUNTRIES_' . $i;
$keys[count($keys)] = 'MODULE_SHIPPING_AP_COST_' . $i;
}

return $keys;
}
}
?>

Das ganze habe ich manuell einwenig umgearbeitet damit es im Endeffekt so aussah:

class ap {
var $code, $title, $description, $icon, $enabled, $num_ap;

// class constructor
function ap() {
global $order;

$this->code = 'ap';
$this->title = MODULE_SHIPPING_AP_TEXT_TITLE;
$this->description = MODULE_SHIPPING_AP_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_AP_SORT_ORDER;
$this->icon = DIR_WS_ICONS . 'shipping_ap.gif';
$this->tax_class = MODULE_SHIPPING_AP_TAX_CLASS;
$this->enabled = ((MODULE_SHIPPING_AP_STATUS == 'True') ? true : false);

if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AP_ZONE > 0) ) {
$check_flag = false;
$check_query = tep_db_query("select zone_id from " . TABLE_SHOP2_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AP_ZONE . "' 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 ($check_flag == false) {
$this->enabled = false;
}
}

// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
$this->num_ap = 8;
}

// class methods
function quote($method = '') {
global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes;

$dest_country = $order->delivery['country']['iso_code_2'];
$dest_zone = 0;
$error = false;

for ($i=1; $i<=$this->num_ap; $i++) {
$countries_table = constant('MODULE_SHIPPING_AP_COUNTRIES_' . $i);
$country_zones = split("[,]", $countries_table);
if (in_array($dest_country, $country_zones)) {
$dest_zone = $i;
break;
}
}

if ($dest_zone == 0) {
$error = true;
} else {
$shipping = -1;
$ap_cost = constant('MODULE_SHIPPING_AP_COST_' . $i);
if ($i < $this->num_ap) {

$shipping = MODULE_SHIPPING_AP_BASE + MODULE_SHIPPING_AP_MAUT + ($ap_cost * floor($shipping_weight + 0.99));
$shipping_method = MODULE_SHIPPING_AP_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_AP_TEXT_UNITS;

} else {
$ap_table = split("[:,]" , $ap_cost);
for ($i=0; $i<sizeof($ap_table); $i+=2) {
if ($shipping_weight <= $ap_table[$i]) {
$shipping = $ap_table[$i+1];
$shipping_method = MODULE_SHIPPING_AP_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_AP_TEXT_UNITS;
break;
}
}
}
if ($shipping == -1) {
$shipping_cost = 0;
$shipping_method = MODULE_SHIPPING_AP_UNDEFINED_RATE;
} else {
$shipping_cost = ($shipping + MODULE_SHIPPING_AP_HANDLING);
}
}

$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_AP_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_method . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . ' ' . MODULE_SHIPPING_AP_TEXT_UNITS .')',
'cost' => $shipping_cost * $shipping_num_boxes)));

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);

if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AP_INVALID_ZONE;

return $this->quotes;
}

function check() {
if (!isset($this->_check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_SHOP2_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AP_STATUS'");
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}

function install() {
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Österreichische Post AG', 'MODULE_SHIPPING_AP_STATUS', 'True', 'Wollen Sie den Versand über die Österreichische Post AG anbieten?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AP_HANDLING', '0', 'Bearbeitungsgebühr für diese Versandart in Euro', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Grundpreis', 'MODULE_SHIPPING_AP_BASE', '11.80', 'Grundpreis pro Paket in Euro', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Maut', 'MODULE_SHIPPING_AP_MAUT', '0.12', 'Mautzuschlag pro Paket in Euro', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Steuersatz', 'MODULE_SHIPPING_AP_TAX_CLASS', '0', 'Wählen Sie den MwSt.-Satz für diese Versandart aus.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Versand Zone', 'MODULE_SHIPPING_AP_ZONE', '0', 'Wenn Sie eine Zone auswählen, wird diese Versandart nur in dieser Zone angeboten.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Reihenfolge der Anzeige', 'MODULE_SHIPPING_AP_SORT_ORDER', '0', 'Niedrigste wird zuerst angezeigt.', '6', '0', now())");

tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 1a Länder', 'MODULE_SHIPPING_AP_COUNTRIES_1', 'DE,IT,SM,SK,SI,CZ,HU', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 1a sind.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 1a Tarif', 'MODULE_SHIPPING_AP_COST_1', '0.75', 'Tarif pro angefangenem kg Versandgewicht für Zone 1a.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 1b Länder', 'MODULE_SHIPPING_AP_COUNTRIES_2', 'AD,BE,CY,DK,FO,GL,EE,FI,FR,GR,GB,IE,LV,LI,LT,LU,MC,MT,NL,PL,PT,SE,CH,ES,VA', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 1b sind.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 1b Tarif', 'MODULE_SHIPPING_AP_COST_2', '1', 'Tarif pro angefangenem kg Versandgewicht für Zone 1b.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 2 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_3', & #39;EG,AL,DZ,AM,AZ,BA,BG,GE,GI,IS,IL,YU,HR,LV,LB,LY,MA,MK,MD,NO,RO,RU,SY,TN,TR,U
A,BY', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 2 sind.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 2 Tarif', 'MODULE_SHIPPING_AP_COST_3', '2', 'Tarif pro angefangenem kg Versandgewicht für Zone 2.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 3 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_4', & #39;ET,BH,BJ,BF,CI,DJ,ER,GM,GH,GU,GN,GW,IQ,IR,YE,JO,CM,CA,CV,KZ,QA,KG,KW,LR,ML,M
H,MR,FM,NE,NG,MP,OM,PR,SA,SN,SL,SO,SD,TJ,TG,TD,TM,UZ,AE,US,UM,CF', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 3 sind.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 3 Tarif', 'MODULE_SHIPPING_AP_COST_4', '3', 'Tarif pro angefangenem kg Versandgewicht für Zone 3.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 4 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_5', & #39;AF,AO,AI,AG,GQ,AR,BS,BD,BB,BZ,BM,BT,BO,BW,BR,BN,BI,KY,CL,CN,CR,DM,DO,EC,SV,F
K,GF,GA,GD,GP,GT,GY,HT,HN,HK,IN,ID,TP,JM,JP,KH,KE,CO,KM,CG,KP,KR,CU,LA,LS', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 4 sind.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 4 Tarif', 'MODULE_SHIPPING_AP_COST_5', '4.5', 'Tarif pro angefangenem kg Versandgewicht für Zone 4.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 4 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_6', & #39;MO,MG,MW,MY,MV,MQ,MU,MX,MN,MS,MZ,MM,NA,NP,NI,AN,AW,PK,PA,PY,PE,PH,RE,RW,ZM,S
T,SC,ZW,SG,LK,KN,LC,PM,VC,ZA,SR,SZ,TZ,TH,TT,TC,UG,UY,VE,VN,VG', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 4 sind.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 4 Tarif', 'MODULE_SHIPPING_AP_COST_6', '4.5', 'Tarif pro angefangenem kg Versandgewicht für Zone 4.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 5 Länder', 'MODULE_SHIPPING_AP_COUNTRIES_7', 'AU,CK,FJ,PF,KI,NR,NC,NZ,PG,PN,SB,TO,TV,VU,WF,WS', 'Durch Komma getrennt Liste der Länder als zwei Zeichen ISO-Code Landeskennzahlen, die Teil der Zone 5 sind.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone 5 Tarif', 'MODULE_SHIPPING_AP_COST_7', '6.5', 'Tarif pro angefangenem kg Versandgewicht für Zone 5.', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone Inland', 'MODULE_SHIPPING_AP_COUNTRIES_8', 'AT', 'Inlandszone', '6', '0', now())");
tep_db_query("insert into " . TABLE_SHOP2_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone Tarif Tabelle bis 31.5 kg', 'MODULE_SHIPPING_AP_COST_8', '2:4.12,4:5.12,8:6.22,12:7.72,20:9.82,31.5:12.92', 'Tarif Tabelle für die Inlandszone, bis 31.5 kg Versandgewicht.', '6', '0', now())");
}

function remove() {
tep_db_query("delete from " . TABLE_SHOP2_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
$keys = array('MODULE_SHIPPING_AP_STATUS', 'MODULE_SHIPPING_AP_HANDLING', 'MODULE_SHIPPING_AP_BASE', 'MODULE_SHIPPING_AP_MAUT', 'MODULE_SHIPPING_AP_TAX_CLASS', 'MODULE_SHIPPING_AP_ZONE', 'MODULE_SHIPPING_AP_SORT_ORDER');

for ($i = 1; $i <= $this->num_ap; $i ++) {
$keys[count($keys)] = 'MODULE_SHIPPING_AP_COUNTRIES_' . $i;
$keys[count($keys)] = 'MODULE_SHIPPING_AP_COST_' . $i;
}

return $keys;
}
}
?>

Nur bekomme ich jetzt folgende Fehlermeldung wenn ich versuche ins Versandmenue im admin zu kommen.

Folgender ERROR:

1146 - Table 'u1242_db1.TABLE_SHOP2_CONFIGURATION' doesn't exist

select configuration_value from TABLE_SHOP2_CONFIGURATION where configuration_key = 'MODULE_SHIPPING_AP_STATUS'

[TEP STOP]

Hat jeman Rat wie ich das ganze mit prefixen angehen soll?

Danke,

Link to comment
Share on other sites

×
×
  • Create New...