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: Versandkosten DHL und Hermes pauschal und ab xx Euro frei

    Lkwjoe

    • Frisch an Board
    • Beiträge: 58
    Hallo zusammen,

    ich suche mir gerade einen Wolf...

    - Ich möchte als Versanddienstleister DHL und Hermes anbieten.
    - Bei beiden Versendern pauschale Versandkosten, z.B. in DE DHL 4,90 Euro und Hermes 4,30 Euro, unabhängig von Artikelanzahl und Gewicht
    - Bei beiden Versendern ab z.B. 50,- Euro Bestellwert Versandkostenfrei
    Für DE.
    Für CH und EU dann natürlich auch noch, mit entsprechend höheren VK und höherem Bestellwert für VK-Frei.

    Geht das? Ich hab mir mal die Tabellarischen Versandkosten angeschaut, aber ich denke das Modul allein wird ja nicht reichen...?

    Wäre klasse wenn da jemand weiter weiss...!

    Danke und Gruss,
    Joe



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

    DJ-Ready

    • Mitglied
    • Beiträge: 218
    • Geschlecht:
    Versandkosten DHL und Hermes pauschal und ab xx Euro frei
    Antwort #1 am: 28. Juni 2010, 13:59:05
    Das könntest du ganz einfach mit dem "Tabellarische Versandkosten" Modul machen.

    80:4.62,10000:0.00 ist bei uns z.b. drin für DE; bis 80 EUR 4.65 (bzw 5.50 mit mwst) und dann da drüber bis 10000 EUR versandkostenfrei. Als erlaubte Zone stellst du DE ein und schon geht das Modul nur für DE Versand. Für Versand nach AT oder CH oder sonstwo kannst du einfach Kopien des Moduls machen und dann auch die enstprechenden Zonen festlegen.

    Das selbe oder sogar noch mehr wäre auch mit dem "Versandkosten Zonenbasierend" Modul möglich. Ist ein wenig komplizierter zu konfigurieren aber im prinzip genau so nur in einem Modul anstatt 3

    [ Für Gäste sind keine Dateianhänge sichtbar ]

    Modul halt kopieren und umbenennen und daraus DHL/Hermes/DPD/UPS/whatever machen um genau das selbe mit mehreren Anbietern zu kriegen :)

    Lkwjoe

    • Frisch an Board
    • Beiträge: 58
    Versandkosten DHL und Hermes pauschal und ab xx Euro frei
    Antwort #2 am: 28. Juni 2010, 17:53:04
    Modul halt kopieren und umbenennen und daraus DHL/Hermes/DPD/UPS/whatever machen um genau das selbe mit mehreren Anbietern zu kriegen :)
    Das hat mir gefehlt, bin nicht drauf gekommen!

    Super, vielen Dank!

    Grüsse,
    Joe

    Lkwjoe

    • Frisch an Board
    • Beiträge: 58
    Versandkosten DHL und Hermes pauschal und ab xx Euro frei
    Antwort #3 am: 06. Juli 2010, 12:44:24
    Hallo zusammen,

    das Einrichten der "Tabellarischen Versandkosten" hat soweit gut funktioniert, nur hängt jetzt der Bezahlvorgang, d.h. wenn  Kunde bei "Versandart wählen" eine der Tabellarischen Versandoptionen wählt, dann gehts nicht weiter, es erscheint immer wieder die "Versandart wählen"-Seite. Wählt man eine der anderen Optionen, z.B. DPD, dann klappts.

    Woran könnte das liegen, habe ich etwas falsch eingestellt?
    Habe die "Tabellarischen Versandkosten" so angelegt:

      [ Für Gäste sind keine Dateianhänge sichtbar ]
    Das Gleiche dann noch einmal für Hermes...
      [ Für Gäste sind keine Dateianhänge sichtbar ]

    Gruss,
    Joe

    web28

    • modified Team
    • Beiträge: 9.404
    Versandkosten DHL und Hermes pauschal und ab xx Euro frei
    Antwort #4 am: 06. Juli 2010, 13:19:24
    Hast Du die Module korrekt geclont? (nur kopieren und umbenennen reicht nicht)

    Gruss Web28

    Lkwjoe

    • Frisch an Board
    • Beiträge: 58
    Versandkosten DHL und Hermes pauschal und ab xx Euro frei
    Antwort #5 am: 06. Juli 2010, 13:22:15
    Hast Du die Module korrekt geclont? (nur kopieren und umbenennen reicht nicht)
    [...]

    Ich denke schon, hab so gemacht wie hier beschrieben: Tutorial: Kopieren eines Versandmoduls

    Sollte eigentlich stimmen, ich kontrolliere es aber noch einmal.

    Danke und Gruss,
    Joe

    [EDIT Tomcraft 13.01.2020: Link auf eigenes Wiki geändert, da alter Link nicht mehr verfügbar.]

    hendrik

    • Experte
    • Beiträge: 2.038
    Versandkosten DHL und Hermes pauschal und ab xx Euro frei
    Antwort #6 am: 06. Juli 2010, 13:23:10
    Das Kopieren der Module hast du sorgfältig durchgeführt?
    Siehe: Tutorial: Kopieren eines Versandmoduls

    Gruß
    Hen

    [EDIT Tomcraft 13.01.2020: Link auf eigenes Wiki geändert, da alter Link nicht mehr verfügbar.]

    Lkwjoe

    • Frisch an Board
    • Beiträge: 58
    Versandkosten DHL und Hermes pauschal und ab xx Euro frei
    Antwort #7 am: 06. Juli 2010, 18:29:41
    Ok, hab den Fehler entdeckt:
    Habe die Klassen, Funktionen u.s.w. umbenannt von 'table' in z.B. 'dhl_de_table'. Ergo auch die Moduleinträge von 'MODULE_SHIPPING_TABLE_...' in z.B. 'MODULE_SHIPPING_DHL_DE_TABLE_...'.
    Das hat das System nicht gemocht... ;)

    Also, alles ok!

    Danke und Gruss,
    Joe

    Cosmicbase

    • Frisch an Board
    • Beiträge: 70
    Hallo,

    also ich habe das Modul table kopiert und in dhl umbenannt.

    Genauso

    define('MODULE_SHIPPING_DHL_TEXT_TITLE', 'DHL');
    define('MODULE_SHIPPING_DHL_TEXT_DESCRIPTION', 'DHL - Weltweites Versandmodul');
    define('MODULE_SHIPPING_DHL_TEXT_WAY', 'Versand nach');

    Jetzt steht unter Modul DHL und das was halt oben zu sehen ist.

    Habe aber die Werte nur unter lang/... geändert.

    Habe aber das problem mit dem Nachnahmeentgelt... Kann keinen Paketdienst für meinen Eintrag finden,bzw. Nachnahmeentgeld anlegen.

    Hier meine order_total/ot_cod_fee.

    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: ot_cod_fee.php 1002 2005-07-10 16:11:37Z mz $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(ot_cod_fee.php,v 1.02 2003/02/24); www.oscommerce.com
       (C) 2001 - 2003 TheMedia, Dipl.-Ing Thomas Plänkers ; http://www.themedia.at & http://www.oscommerce.at

       Released under the GNU General Public License
       -----------------------------------------------------------------------------------------
       Third Party contributions:

       Adapted for xtcommerce 2003/09/30 by Benax (axel.benkert@online-power.de)

       Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)
       http://www.oscommerce.com/community/contributions,282
       Copyright (c) Strider | Strider@oscworks.com
       Copyright (c  Nick Stanko of UkiDev.com, nick@ukidev.com
       Copyright (c) Andre ambidex@gmx.net
       Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org

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

      class ot_cod_fee {
        var $title, $output;

        function ot_cod_fee() {
              global $xtPrice;
          $this->code = 'ot_cod_fee';
          $this->title = MODULE_ORDER_TOTAL_COD_FEE_TITLE;
          $this->description = MODULE_ORDER_TOTAL_COD_FEE_DESCRIPTION;
          $this->enabled = ((MODULE_ORDER_TOTAL_COD_FEE_STATUS == 'true') ? true : false);
          $this->sort_order = MODULE_ORDER_TOTAL_COD_FEE_SORT_ORDER;

          $this->output = array();
        }

        function process() {
          global $order, $xtPrice, $cod_cost, $cod_country, $shipping;

          if (MODULE_ORDER_TOTAL_COD_FEE_STATUS == 'true') {

            //Will become true, if cod can be processed.
            $cod_country = false;

            //check if payment method is cod. If yes, check if cod is possible.
            if ($_SESSION['payment'] == 'cod') {
              //process installed shipping modules
             // BOF - Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
              if ($_SESSION['shipping']['id'] == 'flat_flat') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
              if ($_SESSION['shipping']['id'] == 'item_item') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
              if ($_SESSION['shipping']['id'] == 'table_table') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
              if ($_SESSION['shipping']['id'] == 'zones_zones') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
              if ($_SESSION['shipping']['id'] == 'ap_ap') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_AP);
              if ($_SESSION['shipping']['id'] == 'dp_dp') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DP);

                        // module chp
              if ($_SESSION['shipping']['id'] == 'chp_ECO') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
              if ($_SESSION['shipping']['id'] == 'chp_PRI') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
              if ($_SESSION['shipping']['id'] == 'chp_URG') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);

              // module chronopost
              if ($_SESSION['shipping']['id'] == 'chronopost_chronopost') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST);

              // module DHL
              if ($_SESSION['shipping']['id'] == 'dhl_ECX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_DOX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_SDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_MDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_WPX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
             // UPS
              if ($_SESSION['shipping']['id'] == 'ups_ups') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPS);
              if ($_SESSION['shipping']['id'] == 'upse_upse') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPSE);

              // Free Shipping
              if ($_SESSION['shipping']['id'] == 'free_free') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FREE);
              if ($_SESSION['shipping']['id'] == 'freeamount_freeamount') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_FREEAMOUNT_FREE);
            // EOF - Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3

                for ($i = 0; $i < count($cod_zones); $i++) {
                if ($cod_zones[$i] == $order->delivery['country']['iso_code_2']) {
                      $cod_cost = $cod_zones[$i + 1];
                      $cod_country = true;
                      break;
                    } elseif ($cod_zones[$i] == '00') {
                      $cod_cost = $cod_zones[$i + 1];
                      $cod_country = true;
                      break;
                    } else {
                    }
                  $i++;
                }
              } else {
                //COD selected, but no shipping module which offers COD
              }

            if ($cod_country) {

                $cod_tax = xtc_get_tax_rate(MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
                $cod_tax_description = xtc_get_tax_description(MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
            if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
                $order->info['tax'] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $order->info['tax_groups'][TAX_ADD_TAX . "$cod_tax_description"] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $order->info['total'] += $cod_cost + (xtc_add_tax($cod_cost, $cod_tax)-$cod_cost);
                $cod_cost_value= xtc_add_tax($cod_cost, $cod_tax);
                $cod_cost= $xtPrice->xtcFormat($cod_cost_value,true);
            }
            if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
                $order->info['tax'] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $order->info['tax_groups'][TAX_NO_TAX . "$cod_tax_description"] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $cod_cost_value=$cod_cost;
                $cod_cost= $xtPrice->xtcFormat($cod_cost,true);
                $order->info['subtotal'] += $cod_cost_value;
                $order->info['total'] += $cod_cost_value;
            }
            if (!$cod_cost_value) {
               $cod_cost_value=$cod_cost;
               $cod_cost= $xtPrice->xtcFormat($cod_cost,true);
               $order->info['total'] += $cod_cost_value;
            }
                $this->output[] = array('title' => $this->title . ':',
                                        'text' => $cod_cost,
                                        'value' => $cod_cost_value);
            } else {
    //Following code should be improved if we can't get the shipping modules disabled, who don't allow COD
    // as well as countries who do not have cod
    //          $this->output[] = array('title' => $this->title . ':',
    //                                  'text' => 'No COD for this module.',
    //                                  'value' => '');
            }
          }
        }

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

        function keys() {
          return array('MODULE_ORDER_TOTAL_COD_FEE_STATUS', 'MODULE_ORDER_TOTAL_COD_FEE_SORT_ORDER', 'MODULE_ORDER_TOTAL_COD_FEE_FLAT', 'MODULE_ORDER_TOTAL_COD_FEE_ITEM', 'MODULE_ORDER_TOTAL_COD_FEE_TABLE','MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST','MODULE_ORDER_TOTAL_COD_FEE_DHL','MODULE_ORDER_TOTAL_COD_FEE_CHP', 'MODULE_ORDER_TOTAL_COD_FEE_ZONES', 'MODULE_ORDER_TOTAL_COD_FEE_AP', 'MODULE_ORDER_TOTAL_COD_FEE_UPS', 'MODULE_ORDER_TOTAL_COD_FEE_UPSE', 'MODULE_ORDER_TOTAL_COD_FEE_DP', 'MODULE_ORDER_TOTAL_COD_FEE_FREE', 'MODULE_ORDER_TOTAL_FREEAMOUNT_FREE', 'MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS');
        }

        function install() {
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_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_ORDER_TOTAL_COD_FEE_SORT_ORDER', '35', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_FLAT', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_ITEM', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_TABLE', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_ZONES', 'CA:4.50,US:3.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_AP', 'AT:3.63,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_DP', 'DE:4.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_CHP', 'CH:4.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST', 'FR:4.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_DHL', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_UPS', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_UPSE', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_FREE', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_FREEAMOUNT_FREE', 'AT:3.00,DE:3.58,00:9.99', '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_ORDER_TOTAL_COD_FEE_TAX_CLASS', '0', '6', '0', 'xtc_get_tax_class_title', 'xtc_cfg_pull_down_tax_classes(', now())");
        }

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

    Bitte um Hilfe..

    Cosmicbase

    • Frisch an Board
    • Beiträge: 70
    Hallo,

    also ich habe das Modul table kopiert und in dhl umbenannt.

    Genauso

    define('MODULE_SHIPPING_DHL_TEXT_TITLE', 'DHL');
    define('MODULE_SHIPPING_DHL_TEXT_DESCRIPTION', 'DHL - Weltweites Versandmodul');
    define('MODULE_SHIPPING_DHL_TEXT_WAY', 'Versand nach');

    Jetzt steht unter Modul DHL und das was halt oben zu sehen ist.

    Habe aber die Werte nur unter lang/... geändert.

    Habe aber das problem mit dem Nachnahmeentgelt... Kann keinen Paketdienst für meinen Eintrag finden,bzw. Nachnahmeentgeld anlegen.

    Hier meine order_total/ot_cod_fee.

    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: ot_cod_fee.php 1002 2005-07-10 16:11:37Z mz $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(ot_cod_fee.php,v 1.02 2003/02/24); www.oscommerce.com
       (C) 2001 - 2003 TheMedia, Dipl.-Ing Thomas Plänkers ; http://www.themedia.at & http://www.oscommerce.at

       Released under the GNU General Public License
       -----------------------------------------------------------------------------------------
       Third Party contributions:

       Adapted for xtcommerce 2003/09/30 by Benax (axel.benkert@online-power.de)

       Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)
       http://www.oscommerce.com/community/contributions,282
       Copyright (c) Strider | Strider@oscworks.com
       Copyright (c  Nick Stanko of UkiDev.com, nick@ukidev.com
       Copyright (c) Andre ambidex@gmx.net
       Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org

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

      class ot_cod_fee {
        var $title, $output;

        function ot_cod_fee() {
              global $xtPrice;
          $this->code = 'ot_cod_fee';
          $this->title = MODULE_ORDER_TOTAL_COD_FEE_TITLE;
          $this->description = MODULE_ORDER_TOTAL_COD_FEE_DESCRIPTION;
          $this->enabled = ((MODULE_ORDER_TOTAL_COD_FEE_STATUS == 'true') ? true : false);
          $this->sort_order = MODULE_ORDER_TOTAL_COD_FEE_SORT_ORDER;

          $this->output = array();
        }

        function process() {
          global $order, $xtPrice, $cod_cost, $cod_country, $shipping;

          if (MODULE_ORDER_TOTAL_COD_FEE_STATUS == 'true') {

            //Will become true, if cod can be processed.
            $cod_country = false;

            //check if payment method is cod. If yes, check if cod is possible.
            if ($_SESSION['payment'] == 'cod') {
              //process installed shipping modules
             // BOF - Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
              if ($_SESSION['shipping']['id'] == 'flat_flat') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
              if ($_SESSION['shipping']['id'] == 'item_item') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
              if ($_SESSION['shipping']['id'] == 'table_table') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
              if ($_SESSION['shipping']['id'] == 'zones_zones') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
              if ($_SESSION['shipping']['id'] == 'ap_ap') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_AP);
              if ($_SESSION['shipping']['id'] == 'dp_dp') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DP);

                        // module chp
              if ($_SESSION['shipping']['id'] == 'chp_ECO') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
              if ($_SESSION['shipping']['id'] == 'chp_PRI') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
              if ($_SESSION['shipping']['id'] == 'chp_URG') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);

              // module chronopost
              if ($_SESSION['shipping']['id'] == 'chronopost_chronopost') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST);

              // module DHL
              if ($_SESSION['shipping']['id'] == 'dhl_ECX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_DOX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_SDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_MDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
              if ($_SESSION['shipping']['id'] == 'dhl_WPX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
             // UPS
              if ($_SESSION['shipping']['id'] == 'ups_ups') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPS);
              if ($_SESSION['shipping']['id'] == 'upse_upse') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPSE);

              // Free Shipping
              if ($_SESSION['shipping']['id'] == 'free_free') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FREE);
              if ($_SESSION['shipping']['id'] == 'freeamount_freeamount') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_FREEAMOUNT_FREE);
            // EOF - Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3

                for ($i = 0; $i < count($cod_zones); $i++) {
                if ($cod_zones[$i] == $order->delivery['country']['iso_code_2']) {
                      $cod_cost = $cod_zones[$i + 1];
                      $cod_country = true;
                      break;
                    } elseif ($cod_zones[$i] == '00') {
                      $cod_cost = $cod_zones[$i + 1];
                      $cod_country = true;
                      break;
                    } else {
                    }
                  $i++;
                }
              } else {
                //COD selected, but no shipping module which offers COD
              }

            if ($cod_country) {

                $cod_tax = xtc_get_tax_rate(MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
                $cod_tax_description = xtc_get_tax_description(MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
            if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
                $order->info['tax'] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $order->info['tax_groups'][TAX_ADD_TAX . "$cod_tax_description"] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $order->info['total'] += $cod_cost + (xtc_add_tax($cod_cost, $cod_tax)-$cod_cost);
                $cod_cost_value= xtc_add_tax($cod_cost, $cod_tax);
                $cod_cost= $xtPrice->xtcFormat($cod_cost_value,true);
            }
            if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
                $order->info['tax'] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $order->info['tax_groups'][TAX_NO_TAX . "$cod_tax_description"] += xtc_add_tax($cod_cost, $cod_tax)-$cod_cost;
                $cod_cost_value=$cod_cost;
                $cod_cost= $xtPrice->xtcFormat($cod_cost,true);
                $order->info['subtotal'] += $cod_cost_value;
                $order->info['total'] += $cod_cost_value;
            }
            if (!$cod_cost_value) {
               $cod_cost_value=$cod_cost;
               $cod_cost= $xtPrice->xtcFormat($cod_cost,true);
               $order->info['total'] += $cod_cost_value;
            }
                $this->output[] = array('title' => $this->title . ':',
                                        'text' => $cod_cost,
                                        'value' => $cod_cost_value);
            } else {
    //Following code should be improved if we can't get the shipping modules disabled, who don't allow COD
    // as well as countries who do not have cod
    //          $this->output[] = array('title' => $this->title . ':',
    //                                  'text' => 'No COD for this module.',
    //                                  'value' => '');
            }
          }
        }

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

        function keys() {
          return array('MODULE_ORDER_TOTAL_COD_FEE_STATUS', 'MODULE_ORDER_TOTAL_COD_FEE_SORT_ORDER', 'MODULE_ORDER_TOTAL_COD_FEE_FLAT', 'MODULE_ORDER_TOTAL_COD_FEE_ITEM', 'MODULE_ORDER_TOTAL_COD_FEE_TABLE','MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST','MODULE_ORDER_TOTAL_COD_FEE_DHL','MODULE_ORDER_TOTAL_COD_FEE_CHP', 'MODULE_ORDER_TOTAL_COD_FEE_ZONES', 'MODULE_ORDER_TOTAL_COD_FEE_AP', 'MODULE_ORDER_TOTAL_COD_FEE_UPS', 'MODULE_ORDER_TOTAL_COD_FEE_UPSE', 'MODULE_ORDER_TOTAL_COD_FEE_DP', 'MODULE_ORDER_TOTAL_COD_FEE_FREE', 'MODULE_ORDER_TOTAL_FREEAMOUNT_FREE', 'MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS');
        }

        function install() {
          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_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_ORDER_TOTAL_COD_FEE_SORT_ORDER', '35', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_FLAT', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_ITEM', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_TABLE', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_ZONES', 'CA:4.50,US:3.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_AP', 'AT:3.63,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_DP', 'DE:4.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_CHP', 'CH:4.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST', 'FR:4.00,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_DHL', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_UPS', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_UPSE', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_COD_FEE_FREE', 'AT:3.00,DE:3.58,00:9.99', '6', '0', now())");

          xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_FREEAMOUNT_FREE', 'AT:3.00,DE:3.58,00:9.99', '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_ORDER_TOTAL_COD_FEE_TAX_CLASS', '0', '6', '0', 'xtc_get_tax_class_title', 'xtc_cfg_pull_down_tax_classes(', now())");
        }

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

    Bitte um Hilfe..

    Sorry für den langen Text. hab jetzt einen Anhang...

    Templateshop - Eine große Auswahl an neuen und modernen Templates für die modified eCommerce Shopsoftware
    0 Antworten
    1635 Aufrufe
    04. Oktober 2012, 19:02:48 von Rennschnecke123
    2 Antworten
    1680 Aufrufe
    06. Oktober 2010, 06:43:56 von Andreas2
    5 Antworten
    2742 Aufrufe
    15. März 2016, 17:19:46 von noRiddle (revilonetz)
               
    anything