Marktplatz - Eine große Auswahl an neuen und hilfreichen Modulen sowie modernen Templates für die modified eCommerce Shopsoftware
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: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware

    motodrom

    • Neu im Forum
    • Beiträge: 11
    Au Backe ! Habe nicht gesehen, dass es in der Anleitung, nach dem Dateien kopieren, noch weiter geht. Sorry !!!  :datz: Danke für deine Mühe !!

    CojaX89

    • Neu im Forum
    • Beiträge: 32
    Re: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware
    Antwort #421 am: 15. Dezember 2023, 22:01:42
    Hallo,

    das Modul läuft bei modified 3.0.0 leider nicht,
    die /checkout_shipping.php (Warenkorb) bleibt eine weiße Seite.

    Der Error-Log wirft folgendes aus:

    Code: PHP  [Auswählen]
    [2023-12-15 21:57:16]   [error] [modified]      [pid:1769375]   ERROR found for URL: /checkout_shipping.php     {}      {}
    [2023-12-15 21:57:16]   [error] [modified]      [pid:1769375]   Call to undefined function xtc_calculate_tax() in File: /var/www/vhosts/XXX.de/httpdocs/YYY.de/includes/modules/order_total/ot_bulkgoods.php on Line: 74        {}      {}
     

    CojaX89

    • Neu im Forum
    • Beiträge: 32
    Re: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware
    Antwort #422 am: 16. Dezember 2023, 14:54:42
    Habe die Lösung hier in Antwort #382 gefunden.

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.992
    • Geschlecht:
    Re: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware
    Antwort #423 am: 16. Dezember 2023, 22:53:21
    Der Fix ist, mit einer Kondition um ältere Shop-Versionen abzufangen, doch in der aktuellsten Version in Beitrag 1 des vorliegenden Threads enthalten.
    Bevor man hier andere verunsichert sollte man erstmal schauen, ob man überhaupt die aktuellste Version hat.

    Gruß,
    noRiddle

    CojaX89

    • Neu im Forum
    • Beiträge: 32
    Re: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware
    Antwort #424 am: 17. Dezember 2023, 09:39:24
    Hi noRiddle,

    ich habe einen frisch installierten modified 3.0.0 (keinen geupdateten) und das Modul "nr_bulkgoods_costs2.2.zip" frisch installiert und hatte den Fehler erhalten. Von dieser Lösung sehe ich in Beitrag 1 des Threads nichts.

    awids

    • Experte
    • Beiträge: 3.803
    • Geschlecht:
    Re: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware
    Antwort #425 am: 17. Dezember 2023, 10:22:37
    Die Condition ist aber drin:

    Code: PHP  [Auswählen]
          $calc_tax = ($use_price_class ? $xtPrice->calcTax($bulk_costs, $bulk_tax) : xtc_calculate_tax($bulk_costs, $bulk_tax));
          $add_tax = ($use_price_class ? $xtPrice->xtcAddTax($bulk_costs, $bulk_tax) : xtc_add_tax($bulk_costs, $bulk_tax));

    Ich könnte mir vorstellen, dass es eventuell an der Major-Version 2 liegt, auf welche geprüft wird, wir aber jetzt Version 3 und nur noch eine dreistellige Versionierung haben:

    Code: PHP  [Auswählen]
          $use_price_class = PROJECT_MAJOR_VERSION == '2' && PROJECT_MINOR_VERSION > '0.6.0';

    Also müsste die Definition vielleicht erweitert werden?

    Code: PHP  [Auswählen]
          $use_price_class = PROJECT_MAJOR_VERSION == '2' && PROJECT_MINOR_VERSION > '0.6.0' || PROJECT_MAJOR_VERSION == '3';

    Tomcraft

    • modified Team
    • Gravatar
    • Beiträge: 46.370
    • Geschlecht:
    Re: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware
    Antwort #426 am: 17. Dezember 2023, 12:26:54
    Korrekt, sonst greift die Bedingung natürlich nicht.

    @noRiddle
    Erstellst du ein neues Modul 2.3 oder soll ich die Korrektur in Modulversion 2.2 einfach einfügen?

    Grüße

    Torsten

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.992
    • Geschlecht:
    Re: MODUL: Sperrgut Modul 3 Plus für modified eCommerce Shopsoftware
    Antwort #427 am: 17. Dezember 2023, 13:36:18
    @awids
    In meiner Version auf meinem Rechner sieht das so aus
    Code: PHP  [Auswählen]
      function process() {
        global $order, $xtPrice;
        //$use_price_class = PROJECT_MAJOR_VERSION == '2' && PROJECT_MINOR_VERSION > '0.6.0';
        $use_price_class = method_exists($xtPrice, 'xtcAddTax');

    Da habe ich wohl eine Versionierung vergessen.

    Sorry, CojaX89.

    Gruß,
    noRiddle

    *NACHTRAG*
    Here you go:
    Code: PHP  [Auswählen]
    <?php
    /***************************************************
    * file: ot_bulkgoods.php
    * path: /includes/modules/order_total/
    * use: define bulk goods fees
    *
    * © copyright noRiddle 02-2020
                 ____
                |    |       |     | |
      __   ___  |____/ °  ___|  ___| |  ___
    |/  | |   | |   \  | |   | |   | | |___|
    |   n |___o |    R i |___d |__ d l |__e

    ***************************************************/


    require_once(DIR_FS_CATALOG.DIR_ADMIN.'includes/version.php');

    class ot_bulkgoods {
      public $code, $title, $description, $enabled, $sort_order, $icon, $output;
      private $module_version;

      function __construct() {
        global $xtPrice;
       
        $this->module_version = '2.2';
        $this->code = 'ot_bulkgoods';
        $this->title = defined('MODULE_ORDER_TOTAL_BULKGOODS_TITLE') ? MODULE_ORDER_TOTAL_BULKGOODS_TITLE : '';
        $this->description = defined('MODULE_ORDER_TOTAL_BULKGOODS_DESCRIPTION') ? sprintf(MODULE_ORDER_TOTAL_BULKGOODS_DESCRIPTION, $this->module_version) : '';
        $this->enabled = defined('MODULE_ORDER_TOTAL_BULKGOODS_STATUS') && MODULE_ORDER_TOTAL_BULKGOODS_STATUS == 'true' ? true : false;
        $this->sort_order = defined('MODULE_ORDER_TOTAL_BULKGOODS_SORT_ORDER') ? MODULE_ORDER_TOTAL_BULKGOODS_SORT_ORDER : '';
        $this->icon = '';

        $this->output = array();
      }

      function process() {
        global $order, $xtPrice;
        //$use_price_class = PROJECT_MAJOR_VERSION == '2' && PROJECT_MINOR_VERSION > '0.6.0';
        $use_price_class = method_exists($xtPrice, 'xtcAddTax');
       
        //exclude selfpickup, free shipping, noRiddle
        //if ($order->info['shipping_class'] == 'selfpickup_selfpickup' || $order->info['shipping_class'] == 'freeamount_freeamount') return;
        $excl_shipp_mdls = explode(',', MODULE_ORDER_TOTAL_BULKGOODS_WHICH_SHIPPMODULES_NO);
        $esmdls = array_map(array($this, 'dbl_shipp_module_name'), $excl_shipp_mdls);
        if(in_array($order->info['shipping_class'], $esmdls)) return;

        $bulk_qty = 0;
        $bulk_costs = 0;

        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
          $t_query = xtc_db_query('SELECT products_bulk FROM products WHERE products_id = '.(int)$order->products[$i]['id']);
          $t = xtc_db_fetch_array($t_query);
          if ($t['products_bulk'] > 0) {
            $bulk_qty += $order->products[$i]['qty'];

            //BOC three option for calculating the bulk costs
            if (MODULE_ORDER_TOTAL_BULKGOODS_METHOD == '1') {
              $bulk_costs += ($order->products[$i]['qty'] * $t['products_bulk']);
            } else if (MODULE_ORDER_TOTAL_BULKGOODS_METHOD == '2') {
              $bulk_costs += $t['products_bulk'];
            } else if (MODULE_ORDER_TOTAL_BULKGOODS_METHOD == '3') {
              if ($t['products_bulk'] > $bulk_costs) {
                $bulk_costs = $t['products_bulk'];
              } else {
                $bulk_costs = $bulk_costs;
              }
            }
            //EOC three option for calculating the bulk costs
          }
        }

        if ($bulk_qty > 0) {
          $bulk_tax = xtc_get_tax_rate(MODULE_ORDER_TOTAL_BULKGOODS_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
          $bulk_tax_description = xtc_get_tax_description(MODULE_ORDER_TOTAL_BULKGOODS_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
          $calc_tax = ($use_price_class ? $xtPrice->calcTax($bulk_costs, $bulk_tax) : xtc_calculate_tax($bulk_costs, $bulk_tax));
          $add_tax = ($use_price_class ? $xtPrice->xtcAddTax($bulk_costs, $bulk_tax) : xtc_add_tax($bulk_costs, $bulk_tax));
         
          if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
            $order->info['tax'] += $calc_tax;
            $order->info['tax_groups'][TAX_ADD_TAX . "$bulk_tax_description"] += $calc_tax;
            $order->info['total'] += $bulk_costs + $calc_tax;
            $bulk_order_fee = $add_tax;
            $order->info['subtotal'] += $bulk_order_fee;
          } else if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
            $bulk_order_fee = $bulk_costs;
            $order->info['tax'] += $calc_tax;
            $order->info['tax_groups'][TAX_NO_TAX . "$bulk_tax_description"] += $calc_tax;
            $order->info['subtotal'] += $bulk_order_fee;
            $order->info['total'] += $bulk_order_fee;
          } else if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] != 1) {
            $bulk_order_fee = $bulk_costs;
            $order->info['subtotal'] += $bulk_order_fee;
            $order->info['total'] += $bulk_order_fee;
          }

          $this->output[] = array('title' => MODULE_ORDER_TOTAL_BULKGOODS_CC_TITLE . ':',
                                  'text' => $xtPrice->xtcFormat($bulk_order_fee, true),
                                  'value' => $bulk_order_fee);
        }
      }

      function check() {
        if(!isset($this->_check)) {
          if (defined('MODULE_ORDER_TOTAL_BULKGOODS_STATUS')) {
            $this->_check = 1;
          } else {
            $check_query = xtc_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'MODULE_ORDER_TOTAL_BULKGOODS_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_ORDER_TOTAL_BULKGOODS_STATUS', 'false','6', '1', '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_BULKGOODS_SORT_ORDER', '34','6', '2', 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_BULKGOODS_METHOD', '1', '6', '3', 'xtc_get_bulkgoods_method', 'xtc_cfg_pull_down_bulkgoods_costs_method(', 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_BULKGOODS_TAX_CLASS', '0','6', '4', '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_ORDER_TOTAL_BULKGOODS_WHICH_SHIPPMODULES_NO', 'selfpickup,freeamount','6', '5', now())");
        xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_ORDER_TOTAL_BULKGOODS_WHICH_CONTENT_POPUP', '1','6', '6', now())");

        //add new field to table products to store bulk goods costs
        $field_exists_qu = xtc_db_query("SHOW COLUMNS FROM ".TABLE_PRODUCTS);
        $prod_cols_array = array();
        while($prod_cols_arr = xtc_db_fetch_array($field_exists_qu)) {
            $prod_cols_array[$prod_cols_arr['Field']] = $prod_cols_arr['Type'];
        }

        //if(!in_array('products_bulk', $prod_cols_array)) {
        if(!array_key_exists('products_bulk', $prod_cols_array)) {
          xtc_db_query("ALTER TABLE ".TABLE_PRODUCTS." ADD products_bulk DECIMAL(15,4) NOT NULL DEFAULT 0.0000 AFTER products_price");
        } else {
          if($prod_cols_array['products_bulk'] != 'decimal(15,4)') {
            xtc_db_query("ALTER TABLE ".TABLE_PRODUCTS." MODIFY products_bulk DECIMAL(15,4) NOT NULL DEFAULT 0.0000");
          }
        }
      }
     
      function remove() {
        xtc_db_query("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key LIKE 'MODULE_ORDER_TOTAL_BULKGOODS\_%'");
      }
     
      function keys() {
        return array('MODULE_ORDER_TOTAL_BULKGOODS_STATUS',
                     'MODULE_ORDER_TOTAL_BULKGOODS_SORT_ORDER',
                     'MODULE_ORDER_TOTAL_BULKGOODS_METHOD',
                     'MODULE_ORDER_TOTAL_BULKGOODS_TAX_CLASS',
                     'MODULE_ORDER_TOTAL_BULKGOODS_WHICH_SHIPPMODULES_NO',
                     'MODULE_ORDER_TOTAL_BULKGOODS_WHICH_CONTENT_POPUP'
        );
      }
     
      //helper functions
      function dbl_shipp_module_name($mdl_name) {
        $dbl_mdl_name = $mdl_name.'_'.$mdl_name;
       
        return $dbl_mdl_name;
      }
    }
    ?>

    [EDIT Tomcraft 17.12.2023: Modul in Beitrag 1 aktualisiert.]
    Werbung / Banner buchen
               
    anything