Seite 1 von 2 12 LetzteLetzte
Ergebnis 1 bis 10 von 12

Thema: Edit Orders 4.3.0 PHP Warning: Illegal string offset 'id'

  1. #1
    Padawan Stufe II Avatar von ldiemer
    Registriert seit
    27.08.2004
    Beiträge
    108
    Themen
    30
    DANKE
    15
    Erhaltene Danke: 0

    Standard Edit Orders 4.3.0 PHP Warning: Illegal string offset 'id'

    Hi zusammen,

    ich habe gerade mal mein Modul Edit Orders "erneuert" auf die Version 4.3.0 vom 10.11.2017. Ich hatte vorher schon 4.3.0 drauf, aber von einem etwas früheres Datum. Scheint auch soweit zu funktionieren.

    Bei der Durchsicht der Logs ist mir aufgefallen, dass bei jeder EO-Aktion ADM-Logs produziert werden. Ist ne PHP Warning "Illegal string offset 'id' ...". Das Ganze in der Datei /includes/modules/order_total/ot_shipping.php. Ich habe Euch mal drei der Logs angehängt, sehen immer ähnlich aus.

    myDEBUG-adm-1511781647-812060.txt
    myDEBUG-adm-1511781647-693041.txt
    myDEBUG-adm-1511781639-603397.txt

    Da ich nicht der begnadete Programmiere vor dem Herrn bin, wollte ich das hier mal in die Runde geben, ggf. ist es nicht wichtig oder auch leicht zu korrigieren... Ich kann die Auswirkungen nicht abschätzen.

    BTW: den Fehler hatte ich bei der bereits installierten Version vor dem Update auch schon, daher dachte ich, dass die neuen Dateiversionen ggf. das Problem lösen.

    Falls ich was checken, testen oder probieren soll, immer her damit...

    LG
    Lutz
    Geändert von ldiemer (27.11.2017 um 12:40 Uhr)

  2. #2
    Jedi-Ritter Avatar von webchills
    Registriert seit
    30.10.2004
    Ort
    Österreich
    Beiträge
    6.846
    Themen
    94
    DANKE
    3
    Erhaltene Danke: 1.188

    Standard

    Poste die PHP Version.
    Und den kompletten Inhalt der includes/modules/order_total_ot_shipping.php als Code (# Schaltfläche verwenden)
    !!! kostenloser Support ausschließlich im Forum - Nicht per Email, nicht per Telefon und nicht per PM !!!

  3. #3
    Padawan Stufe II Avatar von ldiemer
    Registriert seit
    27.08.2004
    Beiträge
    108
    Themen
    30
    DANKE
    15
    Erhaltene Danke: 0
    Erstellt von

    Standard

    Moin,

    PHP Version = 7.0.20-nmm1 (Zend: 3.0.0)

    Code:
    <?php
    /**
     * ot_shipping order-total module
     *
     * @package orderTotal
     * @copyright Copyright 2003-2016 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
     * @version $Id: ot_shipping.php for UID 2.6 2016-10-05 17:05:25Z webchills $
     */
      class ot_shipping {
        var $title, $output;
        function __construct() {
          global $order, $currencies;
          $this->code = 'ot_shipping';
          $this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;
          $this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;
          $this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;
          unset($_SESSION['shipping_tax_description']);
          $this->output = array();
          if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
            switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
              case 'national':
                if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
              case 'international':
                if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
              case 'both':
                $pass = true; break;
              default:
                $pass = false; break;
            }
            if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
              $order->info['shipping_method'] = $this->title;
              $order->info['total'] -= $order->info['shipping_cost'];
              $order->info['shipping_cost'] = 0;
            }
          }
          $module = (isset($_SESSION['shipping']) && isset($_SESSION['shipping']['id'])) ? substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_')) : '';
          if (is_object(($order)) && zen_not_null($order->info['shipping_method'])) {
    // TVA_INTRACOM REPLACE BEGIN
    //if ($GLOBALS[$module]->tax_class > 0) {
    $tva_tax = $order->customer['tva_intracom_tax'];
    if (!$tva_tax) {
    $shipping_tax = 0;
    $shipping_tax_description = TEXT_NO_TAX;
    } else {
    $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    // TVA_INTRACOM REPLACE END
              if (!isset($GLOBALS[$module]->tax_basis)) {
                $shipping_tax_basis = STORE_SHIPPING_TAX_BASIS;
              } else {
                $shipping_tax_basis = $GLOBALS[$module]->tax_basis;
              }
                
              if ($shipping_tax_basis == 'Billing') {
                $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
              } elseif ($shipping_tax_basis == 'Shipping') {
                $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
              } else {
                if (STORE_ZONE == $order->billing['zone_id']) {
                  $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                  $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                } elseif (STORE_ZONE == $order->delivery['zone_id']) {
                  $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                  $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                } else {
                  $shipping_tax = 0;
                }
         
                             
                      
                   
                                      
                               
                        
                       
                                         
       
            if ($_SESSION['shipping']['id'] == 'free_free') {
              $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
              $order->info['shipping_cost'] = 0;
            }
    // TVA_INTRACOM REPLACE BEGIN
    }
    }
    $calculated_tax = zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
    if($tva_tax){
    $order->info['tax'] += $calculated_tax;
    $order->info['tax_groups']["$shipping_tax_description"] += $calculated_tax;
    $order->info['total'] += $calculated_tax;
    }
              if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
            //}
    // UID REPLACE END
            if ($_SESSION['shipping']['id'] == 'free_free') $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
          }
        }
        function process() {
          global $order, $currencies;
          $this->output[] = array('title' => $order->info['shipping_method'] . ':',
                                  'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                  'value' => $order->info['shipping_cost']);
        }
        function check() {
          global $db;
          if (!isset($this->_check)) {
            $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'");
            $this->_check = $check_query->RecordCount();
          }
          return $this->_check;
        }
        function keys() {
          return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');
        }
        function install() {
          global $db;
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('This module is installed', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', '', '6', '1','zen_cfg_select_option(array(\'true\'), ', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '200', 'Sort order of display.', '6', '2', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'zen_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");
        }
        function remove() {
          global $db;
          $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
        }
      }

  4. #4
    Jedi-Ritter Avatar von webchills
    Registriert seit
    30.10.2004
    Ort
    Österreich
    Beiträge
    6.846
    Themen
    94
    DANKE
    3
    Erhaltene Danke: 1.188

    Standard

    ändere mal Zeile 82
    von
    Code:
    if ($_SESSION['shipping']['id'] == 'free_free') {
    auf
    Code:
    if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free') {
    und Zeile 98 von
    Code:
    if ($_SESSION['shipping']['id'] == 'free_free') $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
    auf
    Code:
    if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free') $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
    Danach ok?
    !!! kostenloser Support ausschließlich im Forum - Nicht per Email, nicht per Telefon und nicht per PM !!!

  5. #5
    Padawan Stufe II Avatar von ldiemer
    Registriert seit
    27.08.2004
    Beiträge
    108
    Themen
    30
    DANKE
    15
    Erhaltene Danke: 0
    Erstellt von

    Standard

    Nee, leider immer noch der gleiche Fehler. Hier nochmal der jetzt geänderte Code - mit ein paar Leerzeilen weniger:

    Code:
    <?php
    /**
     * ot_shipping order-total module
     *
     * @package orderTotal
     * @copyright Copyright 2003-2016 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
     * @version $Id: ot_shipping.php for UID 2.6 2016-10-05 17:05:25Z webchills $
     */
      class ot_shipping {
        var $title, $output;
        function __construct() {
          global $order, $currencies;
          $this->code = 'ot_shipping';
          $this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;
          $this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;
          $this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;
          unset($_SESSION['shipping_tax_description']);
          $this->output = array();
          if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
            switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
              case 'national':
                if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
              case 'international':
                if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
              case 'both':
                $pass = true; break;
              default:
                $pass = false; break;
            }
            if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
              $order->info['shipping_method'] = $this->title;
              $order->info['total'] -= $order->info['shipping_cost'];
              $order->info['shipping_cost'] = 0;
            }
          }
          $module = (isset($_SESSION['shipping']) && isset($_SESSION['shipping']['id'])) ? substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_')) : '';
          if (is_object(($order)) && zen_not_null($order->info['shipping_method'])) {
    // TVA_INTRACOM REPLACE BEGIN
    //if ($GLOBALS[$module]->tax_class > 0) {
    $tva_tax = $order->customer['tva_intracom_tax'];
    if (!$tva_tax) {
    $shipping_tax = 0;
    $shipping_tax_description = TEXT_NO_TAX;
    } else {
    $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    // TVA_INTRACOM REPLACE END
              if (!isset($GLOBALS[$module]->tax_basis)) {
                $shipping_tax_basis = STORE_SHIPPING_TAX_BASIS;
              } else {
                $shipping_tax_basis = $GLOBALS[$module]->tax_basis;
              }
                
              if ($shipping_tax_basis == 'Billing') {
                $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
              } elseif ($shipping_tax_basis == 'Shipping') {
                $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
              } else {
                if (STORE_ZONE == $order->billing['zone_id']) {
                  $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                  $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                } elseif (STORE_ZONE == $order->delivery['zone_id']) {
                  $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                  $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                } else {
                  $shipping_tax = 0;
                }
            if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free') {
              $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
              $order->info['shipping_cost'] = 0;
            }
    // TVA_INTRACOM REPLACE BEGIN
    }
    }
    $calculated_tax = zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
    if($tva_tax){
    $order->info['tax'] += $calculated_tax;
    $order->info['tax_groups']["$shipping_tax_description"] += $calculated_tax;
    $order->info['total'] += $calculated_tax;
    }
              if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
            //}
    // UID REPLACE END
            if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free') $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
          }
        }
        function process() {
          global $order, $currencies;
          $this->output[] = array('title' => $order->info['shipping_method'] . ':',
                                  'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                  'value' => $order->info['shipping_cost']);
        }
        function check() {
          global $db;
          if (!isset($this->_check)) {
            $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'");
            $this->_check = $check_query->RecordCount();
          }
          return $this->_check;
        }
        function keys() {
          return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');
        }
        function install() {
          global $db;
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('This module is installed', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', '', '6', '1','zen_cfg_select_option(array(\'true\'), ', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '200', 'Sort order of display.', '6', '2', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'zen_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");
        }
        function remove() {
          global $db;
          $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
        }
      }
    Hier noch die jetzt entstandenen Log-Files dazu.

    myDEBUG-adm-1511864554-19097.txt
    myDEBUG-adm-1511864609-61926.txt
    myDEBUG-adm-1511864609-554370.txt

    Ausgeführt habe ich folgende Aktion mit EO:


    • Aufruf der Bestellung durch "Mit EDIT ORDERS bearbeiten" -> da entstand schon das erste Log-File
    • Änderung der Versandkosten auf 0 EUR
    • Aktualisieren der Bestellung


    Im Backend sieht alles gut aus, der Betrag ändert sich, Mwst stimmt...

  6. #6
    Jedi-Ritter Avatar von webchills
    Registriert seit
    30.10.2004
    Ort
    Österreich
    Beiträge
    6.846
    Themen
    94
    DANKE
    3
    Erhaltene Danke: 1.188

    Standard

    Es sind ohnehin keine Errors.
    Welche zusätzlichen order_total Module hast Du unter Module > Zusammenfassung aktiv, die in der Grundversion nicht vorkommen?
    Welche zusätzlichen Versandmodule hast Du unter Module > Versandarten aktiv, die in der Grundversion nicht vorkommen?
    Eins davon scheint nicht für PHP 7 angepasst zu sein
    !!! kostenloser Support ausschließlich im Forum - Nicht per Email, nicht per Telefon und nicht per PM !!!

  7. #7
    Padawan Stufe II Avatar von ldiemer
    Registriert seit
    27.08.2004
    Beiträge
    108
    Themen
    30
    DANKE
    15
    Erhaltene Danke: 0
    Erstellt von

    Standard

    mmmh, ich glaube, da habe ich nix besonderes drin...

    Versandmodule.JPG

    Zusammenfassung.JPG

  8. #8
    Padawan Stufe II Avatar von ldiemer
    Registriert seit
    27.08.2004
    Beiträge
    108
    Themen
    30
    DANKE
    15
    Erhaltene Danke: 0
    Erstellt von

    Standard

    Hi zusammen,

    nachdem ich gerade auf 1.5.5f aktualisiere und die Logs checke, ist mir diese Warning wieder untergekommen. Daher wollte ich das nochmal hochholen. Sollte es ein Versandmodul sein, so habe ich zusätzlich nur "Zusätzliche Versandkosten nach Zonen Module für Zen Cart 1.5.5 deutsch" installiert und angepasst. Der Rest ist Standard.

    Hat noch jemand eine Idee, auch wenn es nur eine Warning ist...?

    LG und DANKE
    Lutz

  9. #9
    Jedi-Ritter Avatar von webchills
    Registriert seit
    30.10.2004
    Ort
    Österreich
    Beiträge
    6.846
    Themen
    94
    DANKE
    3
    Erhaltene Danke: 1.188

    Standard

    Das aktuelle UID Modul macht die Änderungen in der includes/modules/order_total/ot_shipping.php nicht so, dass sie ohne Warnings für PHP 7.1 geeignet sind.

    Ändere den Inhalt mal auf folgendes und gib Bescheid, ob die Warning damit nicht mehr kommt

    Code:
    <?php
    /**
     * ot_shipping order-total module
     *
     * @package orderTotal
     * @copyright Copyright 2003-2018 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
     * @version $Id: ot_shipping.php for UID 2018-10-17 22:05:25Z webchills $
     */
    
      class ot_shipping {
        var $title, $output;
    
        function __construct() {
          global $order, $currencies;
          $this->code = 'ot_shipping';
          $this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;
          $this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;
          $this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;
          unset($_SESSION['shipping_tax_description']);
          $this->output = array();
          if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
            switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
              case 'national':
                if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
              case 'international':
                if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
              case 'both':
                $pass = true; break;
              default:
                $pass = false; break;
            }
    
            if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
              $order->info['shipping_method'] = $this->title;
              $order->info['total'] -= $order->info['shipping_cost'];
              $order->info['shipping_cost'] = 0;
            }
          }
          $module = (isset($_SESSION['shipping']) && isset($_SESSION['shipping']['id'])) ? substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_')) : '';
          if (is_object(($order)) && zen_not_null($order->info['shipping_method'])) {
    // TVA_INTRACOM REPLACE BEGIN
    //if ($GLOBALS[$module]->tax_class > 0) {
    $tva_tax = $order->customer['tva_intracom_tax'];
    if (!$tva_tax) {
    $shipping_tax = 0;
    $shipping_tax_description = TEXT_NO_TAX;
    } else {
    $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    // TVA_INTRACOM REPLACE END
              if (!isset($GLOBALS[$module]->tax_basis)) {
                $shipping_tax_basis = STORE_SHIPPING_TAX_BASIS;
              } else {
                $shipping_tax_basis = $GLOBALS[$module]->tax_basis;
              }
                
              if ($shipping_tax_basis == 'Billing') {
                $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
              } elseif ($shipping_tax_basis == 'Shipping') {
                $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
              } else {
                if (STORE_ZONE == $order->billing['zone_id']) {
                  $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                  $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
                } elseif (STORE_ZONE == $order->delivery['zone_id']) {
                  $shipping_tax = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                  $shipping_tax_description = zen_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                } else {
                  $shipping_tax = 0;
                }
            if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free') {
        
              $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
              $order->info['shipping_cost'] = 0;
            }
    
    // TVA_INTRACOM REPLACE BEGIN
    }
    }
    $calculated_tax = zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
    if($tva_tax){
    $order->info['tax'] += $calculated_tax;
    $order->info['tax_groups']["$shipping_tax_description"] += $calculated_tax;
    $order->info['total'] += $calculated_tax;
    }
              if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
            //}
    // UID REPLACE END
    
            if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free')
        
         $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
    
          }
        }
    
        function process() {
          global $order, $currencies;
          $this->output[] = array('title' => $order->info['shipping_method'] . ':',
                                  'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                  'value' => $order->info['shipping_cost']);
        }
    
        function check() {
          global $db;
          if (!isset($this->_check)) {
            $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'");
            $this->_check = $check_query->RecordCount();
          }
          return $this->_check;
        }
    
        function keys() {
          return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');
        }
    
        function install() {
          global $db;
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('This module is installed', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', '', '6', '1','zen_cfg_select_option(array(\'true\'), ', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '200', 'Sort order of display.', '6', '2', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'zen_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");
        }
    
        function remove() {
          global $db;
          $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
        }
      }
    !!! kostenloser Support ausschließlich im Forum - Nicht per Email, nicht per Telefon und nicht per PM !!!

  10. #10
    Padawan Stufe II Avatar von ldiemer
    Registriert seit
    27.08.2004
    Beiträge
    108
    Themen
    30
    DANKE
    15
    Erhaltene Danke: 0
    Erstellt von

    Standard

    Danke webchills, habe ich gemacht. Das war es aber nicht. Wenn ich den Code der ot_shipping-php wie oben erwähnt ändere, dann erhalten ich folgenden Log-Eintrag:
    [18-Oct-2018 07:48:30 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 freeshipper->__construct() called at [/includes/classes/shipping.php:65]
    #2 shipping->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1607]
    #3 eo_get_order_by_id() called at [/130169_admin/edit_orders.php:645]
    [18-Oct-2018 07:48:30 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/shipping/freeshipper.php on line 32
    [18-Oct-2018 07:48:30 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 freeshipper->__construct() called at [/includes/classes/shipping.php:65]
    #2 shipping->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1500]
    #3 eo_get_available_shipping_modules() called at [/130169_admin/edit_orders.php:1228]
    [18-Oct-2018 07:48:30 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/shipping/freeshipper.php on line 32
    [18-Oct-2018 07:48:30 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 freeshipper->__construct() called at [/includes/classes/shipping.php:65]
    #2 shipping->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1500]
    #3 eo_get_available_shipping_modules() called at [/130169_admin/edit_orders.php:1276]
    [18-Oct-2018 07:48:30 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/shipping/freeshipper.php on line 32
    Ich habe dann man den freeshipper (war aktiviert) deaktiviert und der Log-Eintrag verschwindet. Wechsle ich mit deaktiviertem Freeshipper wieder zurück auf die Ursprungsverison von ot_shipping.php, dann erhalte ich wieder Log-Einträge wie folgt:
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1262]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 51
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1262]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 52
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1262]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 61
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1262]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 62
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1265]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 51
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1265]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 52
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1265]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 61
    [18-Oct-2018 07:56:32 Europe/Berlin] Request URI: /zen_test/130169_admin/edit_orders.php?page=1&oID=520828&action=edit, IP address: 95.89.135.142
    #1 ot_shipping->__construct() called at [/includes/classes/order_total.php:52]
    #2 order_total->__construct() called at [/130169_admin/includes/functions/extra_functions/edit_orders_functions.php:1476]
    #3 eo_get_available_order_totals_class_values() called at [/130169_admin/edit_orders.php:1265]
    [18-Oct-2018 07:56:32 Europe/Berlin] PHP Warning: Illegal string offset 'id' in /includes/modules/order_total/ot_shipping.php on line 62
    Es scheint also eine Kombi zu sein aus ot_shipping.php und freeshipper.php. Die von mir verwendete freeshipper.php ist identisch mit der Version aus dem Grundpaket 1.5.5f. Keine Änderungen daran vorgenommen.

    Ggf. hilft mein Test... Danke sehr auf jeden Fall.

    LG
    Lutz

Seite 1 von 2 12 LetzteLetzte

Ähnliche Themen

  1. Edit Orders 4.1.4 weiße Edit-Seite
    Von Takumi im Forum Edit Orders
    Antworten: 11
    Letzter Beitrag: 12.11.2015, 00:28
  2. Illegal string offset 'iso_code_2' in eustandardtransfer.php
    Von NascarFan im Forum Banküberweisung
    Antworten: 4
    Letzter Beitrag: 14.03.2015, 21:15
  3. edit-orders, mega-orders, super-orders... was sollte ich machen?
    Von fish4two im Forum Archivierte Beiträge Zen-Cart Support
    Antworten: 9
    Letzter Beitrag: 12.03.2013, 10:22
  4. Antworten: 4
    Letzter Beitrag: 28.12.2012, 12:22
  5. PHP Warning: strpos() expects parameter 1 to be string
    Von dagoberti im Forum Archivierte Beiträge Zen-Cart Support
    Antworten: 16
    Letzter Beitrag: 03.09.2011, 21:32

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  
zen-cart-pro.at
Zen Cart ist eine kostenlose unter der GPL-Lizenz veröffentlichte Open-Source Shopsoftware. Das System wird in den USA entwickelt, die amerikanische Website dazu ist www.zen-cart.com

Die deutsche Zen-Cart Version, um die es hier auf zen-cart-pro.at geht, ist eine Anpassung der amerikanischen Version an die Bedürfnisse von Onlineshopbetreibern im deutschsprachigen Raum.
Die amerikanische Zen-Cart Version berücksichtigt viele rechtliche Erfordernisse nicht, denen ein Onlineshop im deutschsprachigen Raum unterworfen ist. Daher wurde die deutsche Zen-Cart Version nicht nur bloß ins Deutsche übersetzt, sondern auch funktional auf die Anforderungen, die an Onlineshops in Deutschland, Österreich und der Schweiz gestellt werden, angepasst.

Die amerikanische Version ist extrem abgespeckt und stellt weiterführende Funktionalitäten durch zusätzliche Module bereit, die erst mühsam manuell installiert werden müssen. Zahlreiche häufig genutzte Erweiterungen und eigene Entwicklungen sind in der deutschen Zen Cart Version bereits vorinstalliert.
Die deutsche Zen-Cart Version bietet außerdem einen völlig multilingualen Adminbereich. Weitere für die deutsche Zen Cart Version angepasste Erweiterungen stehen in unserem Downloadbereich zur Verfügung.

Die deutsche Zen Cart Version wird seit 15 Jahren von einem Team von Entwicklern in Österreich und Deutschland betreut, weiterentwickelt und supportet und steht kostenlos in unserem Downloadbereich zur Verfügung.

[mehr]
Follow Us
  • zen-cart-pro-at auf Twitter
  • zen-cart-pro-at auf Github
  • zen-cart-pro-at auf SourceForge
Aktuelle Version
Zen Cart 1.5.6c deutsch
vom 01.09.2019
[Download]

unterstützen
Unterstütze die Weiterentwicklung der deutschen Zen Cart Version mit einer Spende!

Spende für die Weiterentwicklung der deutschen Zen Cart Version