Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Klonen der Versandart ZONES

    peterPain

    • Neu im Forum
    • Beiträge: 14
    Klonen der Versandart ZONES
    am: 19. Mai 2012, 08:14:29
    Guten Morgen !

    ich habe laut EurerAnleitung die Versandart Zones und den zugehörigen Sprachfile nach
    zones2 geklont. Im Adminbereich erhalte ich keine Fehlermeldung nur ist das Modul nahezu leer, d.h.
    ich habe rechts nicht die Optionen wie bei dem Standartzones, was habe ich vergessen umzunennen ?

    Hier meine zones2.php
    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: zones.php 899 2005-04-29 02:40:57Z hhgag $  

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(zones.php,v 1.19 2003/02/05); www.oscommerce.com
       (c) 2003      nextcommerce (zones.php,v 1.7 2003/08/24); www.nextcommerce.org

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/

       
       
    /*
     * USAGE
     * By default, the module comes with support for 1 zone.  This can be
     * easily changed by editing the line below in the zones constructor
     * that defines $this->num_zones.
     *
     * Next, you will want to activate the module by going to the Admin screen,
     * clicking on Modules, then clicking on Shipping.  A list of all shipping
     * modules should appear.  Click on the green dot next to the one labeled
     * zones.php.  A list of settings will appear to the right.  Click on the
     * Edit button.
     *
     * PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
     * SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
     * backup of your shipping settings somewhere at all times.
     *
     * If you want an additional handling charge applied to orders that use this
     * method, set the Handling Fee field.
     *
     * Next, you will need to define which countries are in each zone.  Determining
     * this might take some time and effort.  You should group a set of countries
     * that has similar shipping charges for the same weight.  For instance, when
     * shipping from the US, the countries of Japan, Australia, New Zealand, and
     * Singapore have similar shipping rates.  As an example, one of my customers
     * is using this set of zones:
     *   1: USA
     *   2: Canada
     *   3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
     *      Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
     *      Sweden, Switzerland, Finland, Portugal, Israel, Greece
     *   4: Japan, Australia, New Zealand, Singapore
     *   5: Taiwan, China, Hong Kong
     *
     * When you enter these country lists, enter them into the Zone X Countries
     * fields, where "X" is the number of the zone.  They should be entered as
     * two character ISO country codes in all capital letters.  They should be
     * separated by commas with no spaces or other punctuation. For example:
     *   1: US
     *   2: CA
     *   3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
     *   4: JP,AU,NZ,SG
     *   5: TW,CN,HK
     *
     * Now you need to set up the shipping rate tables for each zone.  Again,
     * some time and effort will go into setting the appropriate rates.  You
     * will define a set of weight ranges and the shipping price for each
     * range.  For instance, you might want an order than weighs more than 0
     * and less than or equal to 3 to cost 5.50 to ship to a certain zone.  
     * This would be defined by this:  3:5.5
     *
     * You should combine a bunch of these rates together in a comma delimited
     * list and enter them into the "Zone X Shipping Table" fields where "X"
     * is the zone number.  For example, this might be used for Zone 1:
     *   1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
     *   12:19.1,13:20.55,14:22,15:23.45
     *
     * The above example includes weights over 0 and up to 15.  Note that
     * units are not specified in this explanation since they should be
     * specific to your locale.
     *
     * CAVEATS
     * At this time, it does not deal with weights that are above the highest amount
     * defined.  This will probably be the next area to be improved with the
     * module.  For now, you could have one last very high range with a very
     * high shipping rate to discourage orders of that magnitude.  For
     * instance:  999:1000
     *
     * If you want to be able to ship to any country in the world, you will
     * need to enter every country code into the Country fields. For most
     * shops, you will not want to enter every country.  This is often
     * because of too much fraud from certain places. If a country is not
     * listed, then the module will add a $0.00 shipping charge and will
     * indicate that shipping is not available to that destination.  
     * PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
     *
     * It appears that the osC shipping system automatically rounds the
     * shipping weight up to the nearest whole unit.  This makes it more
     * difficult to design precise shipping tables.  If you want to, you
     * can hack the shipping.php file to get rid of the rounding.
     *
     * Lastly, there is a limit of 255 characters on each of the Zone
     * Shipping Tables and Zone Countries.
     *
     *  Released under the GNU General Public License
     *
     */


      class zones2 {
        var $code, $title, $description, $enabled, $num_zones2;

    /**
     * class constructor
     */

        function zones2() {
          $this->code = 'zones2';
          $this->title = MODULE_SHIPPING_ZONES2_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_ZONES2_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_SHIPPING_ZONES2_SORT_ORDER;
          $this->icon = '';
          $this->tax_class = MODULE_SHIPPING_ZONES2_TAX_CLASS;
          $this->enabled = ((MODULE_SHIPPING_ZONES2_STATUS == 'True') ? true : false);

    /**
     * CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
     *
     * + CUSTOMIZE THE SETTING IN lang/LANGUAGE/modules/shipping/zones.php
     */


    //BOF - 29.07.2009 - Dokuman - up to 9 zones possible, no changes in langfile needed
          //$this->num_zones = 1;
          $this->num_zones2 = 9;
    //EOF - 29.07.2009 - Dokuman - up to 9 zones possible, no changes in langfile needed
        }

    /**
     * class methods
     */

        function quote($method = '') {
          global $order, $shipping_weight;

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

          for ($i=1; $i<=$this->num_zones2; $i++) {
            $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
            $country_zones = explode(",", $countries_table); // Hetfield - 2009-08-18 - replaced deprecated function split with explode to be ready for PHP >= 5.3
            if (in_array($dest_country, $country_zones)) {
              $dest_zone = $i;
              break;
            }
          }

          if ($dest_zone == 0) {
            $error = true;
          } else {
            $shipping = -1;
            $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);

            $zones_table = preg_split("/[:,]/" , $zones_cost); // Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
            $size = sizeof($zones_table);
            for ($i=0; $i<$size; $i+=2) {
              if ($shipping_weight <= $zones_table[$i]) {
                $shipping = $zones_table[$i+1];
                $shipping_method = MODULE_SHIPPING_ZONES2_TEXT_WAY . ' ' . $dest_country. MODULE_SHIPPING_ZONES2_TEXT_UNITS;
                break;
              }
            }

            if ($shipping == -1) {
              $shipping_cost = 0;
              $shipping_method = MODULE_SHIPPING_ZONES2_UNDEFINED_RATE;
            } else {
              $shipping_cost = ($shipping + constant('MODULE_SHIPPING_ZONES2_HANDLING_' . $dest_zone));
            }
          }

          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ZONES2_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => $shipping_method,
                                                         'cost' => $shipping_cost)));

          if ($this->tax_class > 0) {
            $this->quotes['tax'] = xtc_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
          }

          if (xtc_not_null($this->icon)) $this->quotes['icon'] = xtc_image($this->icon, $this->title);

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

          return $this->quotes;
        }

        function check() {
          if (!isset($this->_check)) {
            $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES2_STATUS'");
            $this->_check = xtc_db_num_rows($check_query);
          }
          return $this->_check;
        }

        function install() {
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_SHIPPING_ZONES2_STATUS', 'True', '6', '0', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_ALLOWED', '', '6', '0', now())");
          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_ZONES2_TAX_CLASS', '0', '6', '0', 'xtc_get_tax_class_title', 'xtc_cfg_pull_down_tax_classes(', now())");
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_SORT_ORDER', '0', '6', '0', now())");
          for ($i = 1; $i <= $this->num_zones; $i++) {
            $default_countries = '';
            if ($i == 1) {
              $default_countries = 'US,CA';
            }
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_COUNTRIES_" . $i ."', '" . $default_countries . "', '6', '0', now())");
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', '6', '0', now())");
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_HANDLING_" . $i."', '0', '6', '0', now())");
          }
        }

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

        function keys() {
          $keys = array('MODULE_SHIPPING_ZONES2_STATUS','MODULE_SHIPPING_ZONES2_ALLOWED', 'MODULE_SHIPPING_ZONES2_TAX_CLASS', 'MODULE_SHIPPING_ZONES2_SORT_ORDER');

          for ($i=1; $i<=$this->num_zones; $i++) {
            $keys[] = 'MODULE_SHIPPING_ZONES2_COUNTRIES_' . $i;
            $keys[] = 'MODULE_SHIPPING_ZONES2_COST_' . $i;
            $keys[] = 'MODULE_SHIPPING_ZONES2_HANDLING_' . $i;
          }

          return $keys;
        }
      }
    ?>

     

    Im Anhang ist ein Screenshot der zones2 optionen im Adminbereich.

    Danke für Eure Hilfe

    Linkback: https://www.modified-shop.org/forum/index.php?topic=20105.0

    GTB

    • modified Team
    • Gravatar
    • Beiträge: 6.306
    • Geschlecht:
    Re: Klonen der Versandart ZONES
    Antwort #1 am: 19. Mai 2012, 08:25:45
    Hi,

    Es wurden einige Konstanten nicht umbenannt.

    Gruss Gerhard

    peterPain

    • Neu im Forum
    • Beiträge: 14
    Re: Klonen der Versandart ZONES
    Antwort #2 am: 20. Mai 2012, 11:38:10
    hmmm....haste ein Beispiel für mich ? Ich finde dort kein zones mehr dass nicht zones2 ist...

    web28

    • modified Team
    • Beiträge: 9.404
    Re: Klonen der Versandart ZONES
    Antwort #3 am: 20. Mai 2012, 13:29:12
    Code: PHP  [Auswählen]
    $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);

    Code: PHP  [Auswählen]
    $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);

    Und die Sprachdateien nicht vergessen.

    Gruss Web28

    peterPain

    • Neu im Forum
    • Beiträge: 14
    Re: Klonen der Versandart ZONES
    Antwort #4 am: 20. Mai 2012, 20:39:12
    Danke für den Hinweis, habe die php Datei nun 3 mal durchgecheckt. Ich finde nichts mehr das auf ein Problem verweist, leider keine Veränderung im Adminbereich. :(

    Es scheint ja ein Problem mit den Versandzonen zu sein, zu rein von der fehlenden Anzeige zu schliessen...
    hmm.....

    Lionne

    • Mitglied
    • Beiträge: 189
    • Geschlecht:
    Re: Klonen der Versandart ZONES
    Antwort #5 am: 20. Mai 2012, 22:11:02
    Hast du auch an die lang/[...]/modules/shipping/zones.php gedacht ?

    Viele Grüße
    Lionne

    peterPain

    • Neu im Forum
    • Beiträge: 14
    Re: Klonen der Versandart ZONES
    Antwort #6 am: 21. Mai 2012, 08:37:50
    ja, natürlich. Aber wäre dem nicht so, würde dann nicht ein Fehler kommen oder komische Ausgabe im Adminbereich ?

    GTB

    • modified Team
    • Gravatar
    • Beiträge: 6.306
    • Geschlecht:
    Re: Klonen der Versandart ZONES
    Antwort #7 am: 21. Mai 2012, 08:39:39
    Poste bitte deine aktuelle Version.

    Gruss Gerhard

    peterPain

    • Neu im Forum
    • Beiträge: 14
    Re: Klonen der Versandart ZONES
    Antwort #8 am: 21. Mai 2012, 09:22:41
    zones2.php:

    Code: PHP  [Auswählen]

    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: zones.php 899 2005-04-29 02:40:57Z hhgag $  

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(zones.php,v 1.19 2003/02/05); www.oscommerce.com
       (c) 2003      nextcommerce (zones.php,v 1.7 2003/08/24); www.nextcommerce.org

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/

       
       
    /*
     * USAGE
     * By default, the module comes with support for 1 zone.  This can be
     * easily changed by editing the line below in the zones constructor
     * that defines $this->num_zones.
     *
     * Next, you will want to activate the module by going to the Admin screen,
     * clicking on Modules, then clicking on Shipping.  A list of all shipping
     * modules should appear.  Click on the green dot next to the one labeled
     * zones.php.  A list of settings will appear to the right.  Click on the
     * Edit button.
     *
     * PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
     * SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
     * backup of your shipping settings somewhere at all times.
     *
     * If you want an additional handling charge applied to orders that use this
     * method, set the Handling Fee field.
     *
     * Next, you will need to define which countries are in each zone.  Determining
     * this might take some time and effort.  You should group a set of countries
     * that has similar shipping charges for the same weight.  For instance, when
     * shipping from the US, the countries of Japan, Australia, New Zealand, and
     * Singapore have similar shipping rates.  As an example, one of my customers
     * is using this set of zones:
     *   1: USA
     *   2: Canada
     *   3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
     *      Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
     *      Sweden, Switzerland, Finland, Portugal, Israel, Greece
     *   4: Japan, Australia, New Zealand, Singapore
     *   5: Taiwan, China, Hong Kong
     *
     * When you enter these country lists, enter them into the Zone X Countries
     * fields, where "X" is the number of the zone.  They should be entered as
     * two character ISO country codes in all capital letters.  They should be
     * separated by commas with no spaces or other punctuation. For example:
     *   1: US
     *   2: CA
     *   3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
     *   4: JP,AU,NZ,SG
     *   5: TW,CN,HK
     *
     * Now you need to set up the shipping rate tables for each zone.  Again,
     * some time and effort will go into setting the appropriate rates.  You
     * will define a set of weight ranges and the shipping price for each
     * range.  For instance, you might want an order than weighs more than 0
     * and less than or equal to 3 to cost 5.50 to ship to a certain zone.  
     * This would be defined by this:  3:5.5
     *
     * You should combine a bunch of these rates together in a comma delimited
     * list and enter them into the "Zone X Shipping Table" fields where "X"
     * is the zone number.  For example, this might be used for Zone 1:
     *   1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
     *   12:19.1,13:20.55,14:22,15:23.45
     *
     * The above example includes weights over 0 and up to 15.  Note that
     * units are not specified in this explanation since they should be
     * specific to your locale.
     *
     * CAVEATS
     * At this time, it does not deal with weights that are above the highest amount
     * defined.  This will probably be the next area to be improved with the
     * module.  For now, you could have one last very high range with a very
     * high shipping rate to discourage orders of that magnitude.  For
     * instance:  999:1000
     *
     * If you want to be able to ship to any country in the world, you will
     * need to enter every country code into the Country fields. For most
     * shops, you will not want to enter every country.  This is often
     * because of too much fraud from certain places. If a country is not
     * listed, then the module will add a $0.00 shipping charge and will
     * indicate that shipping is not available to that destination.  
     * PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
     *
     * It appears that the osC shipping system automatically rounds the
     * shipping weight up to the nearest whole unit.  This makes it more
     * difficult to design precise shipping tables.  If you want to, you
     * can hack the shipping.php file to get rid of the rounding.
     *
     * Lastly, there is a limit of 255 characters on each of the Zone
     * Shipping Tables and Zone Countries.
     *
     *  Released under the GNU General Public License
     *
     */


      class zones2 {
        var $code, $title, $description, $enabled, $num_zones2;

    /**
     * class constructor
     */

        function zones2() {
          $this->code = 'zones2';
          $this->title = MODULE_SHIPPING_ZONES2_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_ZONES2_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_SHIPPING_ZONES2_SORT_ORDER;
          $this->icon = '';
          $this->tax_class = MODULE_SHIPPING_ZONES2_TAX_CLASS;
          $this->enabled = ((MODULE_SHIPPING_ZONES2_STATUS == 'True') ? true : false);

    /**
     * CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
     *
     * + CUSTOMIZE THE SETTING IN lang/LANGUAGE/modules/shipping/zones.php
     */


    //BOF - 29.07.2009 - Dokuman - up to 9 zones possible, no changes in langfile needed
          //$this->num_zones = 1;
          $this->num_zones2 = 9;
    //EOF - 29.07.2009 - Dokuman - up to 9 zones possible, no changes in langfile needed
        }

    /**
     * class methods
     */

        function quote($method = '') {
          global $order, $shipping_weight;

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

          for ($i=1; $i<=$this->num_zones2; $i++) {
            $countries_table = constant('MODULE_SHIPPING_ZONES2_COUNTRIES_' . $i);
            $country_zones = explode(",", $countries_table); // Hetfield - 2009-08-18 - replaced deprecated function split with explode to be ready for PHP >= 5.3
            if (in_array($dest_country, $country_zones)) {
              $dest_zone = $i;
              break;
            }
          }

          if ($dest_zone == 0) {
            $error = true;
          } else {
            $shipping = -1;
            $zones_cost = constant('MODULE_SHIPPING_ZONES2_COST_' . $dest_zone);

            $zones_table = preg_split("/[:,]/" , $zones_cost); // Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
            $size = sizeof($zones_table);
            for ($i=0; $i<$size; $i+=2) {
              if ($shipping_weight <= $zones_table[$i]) {
                $shipping = $zones_table[$i+1];
                $shipping_method = MODULE_SHIPPING_ZONES2_TEXT_WAY . ' ' . $dest_country. MODULE_SHIPPING_ZONES2_TEXT_UNITS;
                break;
              }
            }

            if ($shipping == -1) {
              $shipping_cost = 0;
              $shipping_method = MODULE_SHIPPING_ZONES2_UNDEFINED_RATE;
            } else {
              $shipping_cost = ($shipping + constant('MODULE_SHIPPING_ZONES2_HANDLING_' . $dest_zone));
            }
          }

          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ZONES2_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => $shipping_method,
                                                         'cost' => $shipping_cost)));

          if ($this->tax_class > 0) {
            $this->quotes['tax'] = xtc_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
          }

          if (xtc_not_null($this->icon)) $this->quotes['icon'] = xtc_image($this->icon, $this->title);

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

          return $this->quotes;
        }

        function check() {
          if (!isset($this->_check)) {
            $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES2_STATUS'");
            $this->_check = xtc_db_num_rows($check_query);
          }
          return $this->_check;
        }

        function install() {
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_SHIPPING_ZONES2_STATUS', 'True', '6', '0', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_ALLOWED', '', '6', '0', now())");
          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_ZONES2_TAX_CLASS', '0', '6', '0', 'xtc_get_tax_class_title', 'xtc_cfg_pull_down_tax_classes(', now())");
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_SORT_ORDER', '0', '6', '0', now())");
          for ($i = 1; $i <= $this->num_zones; $i++) {
            $default_countries = '';
            if ($i == 1) {
              $default_countries = 'US,CA';
            }
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_COUNTRIES_" . $i ."', '" . $default_countries . "', '6', '0', now())");
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', '6', '0', now())");
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_SHIPPING_ZONES2_HANDLING_" . $i."', '0', '6', '0', now())");
          }
        }

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

        function keys() {
          $keys = array('MODULE_SHIPPING_ZONES2_STATUS','MODULE_SHIPPING_ZONES2_ALLOWED', 'MODULE_SHIPPING_ZONES2_TAX_CLASS', 'MODULE_SHIPPING_ZONES2_SORT_ORDER');

          for ($i=1; $i<=$this->num_zones; $i++) {
            $keys[] = 'MODULE_SHIPPING_ZONES2_COUNTRIES_' . $i;
            $keys[] = 'MODULE_SHIPPING_ZONES2_COST_' . $i;
            $keys[] = 'MODULE_SHIPPING_ZONES2_HANDLING_' . $i;
          }

          return $keys;
        }
      }
    ?>

     

    language zones2.php:

    Code: PHP  [Auswählen]

    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: zones.php 899 2005-04-29 02:40:57Z hhgag $  

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(zones.php,v 1.3 2002/04/17); www.oscommerce.com
       (c) 2003      nextcommerce (zones.php,v 1.4 2003/08/13); www.nextcommerce.org

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/

       
    // CUSTOMIZE THIS SETTING
    define('NUMBER_OF_ZONES2',10);

    define('MODULE_SHIPPING_ZONES2_TEXT_TITLE', 'DHL Maxibrief bis 1kg | für Hardware/Zubehör');
    define('MODULE_SHIPPING_ZONES2_TEXT_DESCRIPTION', 'Versandkosten Zonenbasierend');
    define('MODULE_SHIPPING_ZONES2_TEXT_WAY', 'Versand nach:');
    define('MODULE_SHIPPING_ZONES2_TEXT_UNITS', '');
    define('MODULE_SHIPPING_ZONES2_INVALID_ZONE', 'Es ist kein Versand in dieses Land m&ouml;glich!');
    define('MODULE_SHIPPING_ZONES2_UNDEFINED_RATE', 'Die Versandkosten k&ouml;nnen im Moment nicht berechnet werden.');

    define('MODULE_SHIPPING_ZONES2_STATUS_TITLE' , 'Versandkosten nach Zonen Methode aktivieren');
    define('MODULE_SHIPPING_ZONES2_STATUS_DESC' , 'M&ouml;chten Sie Versandkosten nach Zonen anbieten?');
    define('MODULE_SHIPPING_ZONES2_ALLOWED_TITLE' , 'Erlaubte Versandzonen');
    define('MODULE_SHIPPING_ZONES2_ALLOWED_DESC' , 'Geben Sie <b>einzeln</b> die Zonen an, in welche ein Versand m&ouml;glich sein soll. (z.B. AT,DE (lassen Sie dieses Feld leer, wenn Sie alle Zonen erlauben wollen))');
    define('MODULE_SHIPPING_ZONES2_TAX_CLASS_TITLE' , 'Steuerklasse');
    define('MODULE_SHIPPING_ZONES2_TAX_CLASS_DESC' , 'Folgende Steuerklasse an Versandkosten anwenden');
    define('MODULE_SHIPPING_ZONES2_SORT_ORDER_TITLE' , 'Sortierreihenfolge');
    define('MODULE_SHIPPING_ZONES2_SORT_ORDER_DESC' , 'Reihenfolge der Anzeige');

    for ($ii=0;$ii<NUMBER_OF_ZONES;$ii++) {
    define('MODULE_SHIPPING_ZONES2_COUNTRIES_'.$ii.'_TITLE' , 'Zone '.$ii.' L&auml;nder');
    define('MODULE_SHIPPING_ZONES2_COUNTRIES_'.$ii.'_DESC' , 'Durch Komma getrennte Liste von ISO L&auml;ndercodes (2 Zeichen), welche Teil von Zone '.$ii.' sind.');
    define('MODULE_SHIPPING_ZONES2_COST_'.$ii.'_TITLE' , 'Zone '.$ii.' Versandkosten');
    define('MODULE_SHIPPING_ZONES2_COST_'.$ii.'_DESC' , 'Versandkosten nach Zone '.$ii.' Bestimmungsorte, basierend auf einer Gruppe von max. Bestellgewichten. Beispiel: 3:8.50,7:10.50,... Gewicht von kleiner oder gleich 3 w&uuml;rde 8.50 f&uuml;r die Zone '.$ii.' Bestimmungsl&auml;nder kosten.');
    define('MODULE_SHIPPING_ZONES2_HANDLING_'.$ii.'_TITLE' , 'Zone '.$ii.' Handling Geb&uuml;hr');
    define('MODULE_SHIPPING_ZONES2_HANDLING_'.$ii.'_DESC' , 'Handling Geb&uuml;hr f&uuml;r diese Versandzone');
    }
    ?>


     

    Lionne

    • Mitglied
    • Beiträge: 189
    • Geschlecht:
    Re: Klonen der Versandart ZONES
    Antwort #9 am: 21. Mai 2012, 22:11:44
    du hast in der zones2.php nicht konsequent

    Code: PHP  [Auswählen]
     $this->num_zones

    auf num_zones2 geändert. Das kann aber alles auf

     
    Code: PHP  [Auswählen]
    $this->num_zones
    bleiben.

    Viele Grüße
    Lionne

    peterPain

    • Neu im Forum
    • Beiträge: 14
    Re: Klonen der Versandart ZONES
    Antwort #10 am: 22. Mai 2012, 09:45:15
    Ok, das wars - es geht.

    Machmal ist man einfach blind .. danke Euch Allen !

    mr.mc.mauser

    • Fördermitglied
    • Beiträge: 343
    • Geschlecht:
    Re: Klonen der Versandart ZONES
    Antwort #11 am: 20. September 2012, 11:26:04
    Hallo,

    auch ich hab ein Problem mit dem Klonen der Versand Zones.
    Habe mehrfach geklont.
    In der Zones_3 gibt es das Problem das ich 10 Zonen benötige.

    Habe in der:
    includes/modules/shipping/zones_3.php
    Code: PHP  [Auswählen]
     $this->num_zones = 11;
    eingetragen

    und in der lang/german/modules/shipping/zones_3.php und in der lang/german/admin/zones_3.php
    Code: PHP  [Auswählen]
    define('NUMBER_OF_ZONES_3',12);
     
    Eingetragen aber es kommt die Fehlermeldung:
    Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES_3_COUNTRIES_10_TITLE in /pfad zum server/admin/modules.php on line 172 Warning: constant():

    Habe im Anhang mal alle 3 Dateien als komisch.zip
    Vielleicht sehe ich den Wald wiedermal vor lauter bäumen nicht !

    Gruß
    Robert

    mr.mc.mauser

    • Fördermitglied
    • Beiträge: 343
    • Geschlecht:
    Re: Klonen der Versandart ZONES
    Antwort #12 am: 20. September 2012, 12:22:17
    Hat sich erledigt,

    es war der Wald und die Bäume:
    wenn man in den und in der lang/german/modules/shipping/zones_3.php und in der lang/german/admin/zones_3.php
    das ändert
    Code: PHP  [Auswählen]
    define('NUMBER_OF_ZONES_3',12);
    muss man weiter unten auch das ändern:
    Code: PHP  [Auswählen]
    for ($ii=0;$ii<NUMBER_OF_ZONES_3;$ii++) {

    Nix für ungut
    Robert

    mr.mc.mauser

    • Fördermitglied
    • Beiträge: 343
    • Geschlecht:
    Re: Klonen der Versandart ZONES
    Antwort #13 am: 27. September 2012, 12:07:48
    Hallo,

    falls jemand seine neuen "zones" in zones_X.php benennen möchte gibt es ein kleines Problem
    in der checkout_shipping.php wird das _ abgeschnitten und es geht nicht weiter mit dem Bestellen.

    Da ich das Problem auch hatte, hab ich einfach folgendes gemacht:
    In der checkout_shipping.php das gesucht
    Code: PHP  [Auswählen]
    list ($module, $method) = explode('_', $_SESSION['shipping']);
    und dadurch ersetzt
    Code: PHP  [Auswählen]
    if(strpos($_SESSION['shipping'],"zones_")!==false){
            list ($module, $method) = explode('_zones', $_SESSION['shipping']);
    } else {
            list ($module, $method) = explode('_', $_SESSION['shipping']);
    }

    Ein umbenennen der "zones_X.php" Dateien war nicht möglich, da der Shop schon mit Artikel abhängen Versandkosten arbeitet und das bei 500 Artikeln und 6 Versand Zonen zu ändern..... NEEEE!

    Gruß
    Robert

    web28

    • modified Team
    • Beiträge: 9.404
    Re: Klonen der Versandart ZONES
    Antwort #14 am: 27. September 2012, 12:51:50
    Im Tutorial ist das extra erwähnt

    Zitat
    Alle Vorkommen des Terminus "table" werden ersetzt in "table2". Groß/Kleinschreibung beachten bei der Textsuche. Dabei ist zu beachten, daß nicht einfach mittels der Textfunktion nur das Wort table ersetzt wird sondern alle Vorkommen des Klassen- und Modulnamens "table".

    Achtung: Bei dem neuen Namen auf keinen Fall Unterstriche verwenden: "table_2" funktioniert nicht!

    Quelle:
    https://www.modified-shop.org/wiki/Tutorial:_Kopieren_eines_Versandmoduls

    Gruss Web28
    2 Antworten
    1767 Aufrufe
    09. Januar 2018, 21:18:56 von web28
    2 Antworten
    906 Aufrufe
    19. Januar 2020, 19:46:17 von fritten_fahrer
    Zones SQL Tabelle

    Begonnen von Anonym am Bugfixes

    3 Antworten
    4749 Aufrufe
    09. Juni 2009, 19:41:18 von Tino77