Ankündigung

Einklappen
Keine Ankündigung bisher.

Versandmodul "Price Weight Table" aus OSC anpassen

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Versandmodul "Price Weight Table" aus OSC anpassen

    Liebes Forum

    Ich betreibe einen OSC-Shop, möchte aber auf Zen Cart umsteigen.
    Ein Killerkriterium ist leider das Versandmodul "Price Weight Table" bei OSC.
    Ich habe versucht es anzupassen und auf Zen zum laufen zu bringen. Leider ohne Erfolg.
    Hat jemand damit schon Erfahrungen gemacht oder gar adaptiert?

    Modul "Price Weight Table":
    - tabellarisches Versandmodul in dem in 5 Kostenbändern (Totalbetrag Einkauf) Versandpreise nach Gewicht definiert werden können.

    Das Modul in OSC sieht wie folgt aus:
    Code:
    <?php
    /*
      $Id: table.php,v 1.27 2003/02/05 22:41:52 hpdl Exp $
    
      osCommerce, Open Source E-Commerce Solutions
      [URL]http://www.oscommerce.com[/URL]
    
      Copyright (c) 2003 osCommerce
    
      Released under the GNU General Public License
    */
    
      class pwtable {
        var $code, $title, $description, $icon, $enabled;
    
    // class constructor
        function pwtable() {
          global $order;
    
          $this->code = 'pwtable';
          $this->title = MODULE_SHIPPING_PWTABLE_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_PWTABLE_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_SHIPPING_PWTABLE_SORT_ORDER;
          $this->icon = '';
          $this->tax_class = MODULE_SHIPPING_PWTABLE_TAX_CLASS;
          $this->enabled = ((MODULE_SHIPPING_PWTABLE_STATUS == 'True') ? true : false);
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_PWTABLE_ZONE > 0) ) {
            $check_flag = false;
            $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_PWTABLE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
            while ($check = tep_db_fetch_array($check_query)) {
              if ($check['zone_id'] < 1) {
                $check_flag = true;
                break;
              } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
                $check_flag = true;
                break;
              }
            }
    
            if ($check_flag == false) {
              $this->enabled = false;
            }
          }
        }
    
    // class methods
        function quote($method = '') {
          global $order, $cart, $total_weight, $currencies, $currency, $currency_symbol, $table_costtable,$table_pointer,$weight_pointer,$weight_matrix;
    
          $dest_country = $order->delivery['country']['iso_code_2'];
          $currency_symbol = $currencies->currencies[$currency]['symbol_right'];
          $order_total = $cart->show_total();
          $table_pointer = 0;
          $weight_pointer = 0;
          $weight_matrix =     array( 
                                      (split("[:,]" , MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_0)),
                                      (split("[:,]" , MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_1)),
                                    (split("[:,]" , MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_2)),
                                    (split("[:,]" , MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_3)),
                                    (split("[:,]" , MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_4)),
                                    (split("[:,]" , MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_5)) 
                            );
    
    
          $table_costtable = split("[,]" , MODULE_SHIPPING_PWTABLE_COSTTABLE);
          $size = sizeof($table_costtable);
          for ($i=0; $i<$size; $i++) {
              if ($order_total <= $table_costtable[$i]) {
                    $table_pointer = $i;
                    break;
              }
          }
    
        
          $table_costweight = $weight_matrix[$i];
          $size = sizeof($table_costweight);
          for ($i=0; $i<$size; $i+=2) {
            if ($total_weight <= $table_costweight[$i]) {
              $shipping = $table_costweight[$i+1];
              $weight_pointer = $i;
              break;
            }
          }
    
    
    
    require(DIR_WS_FUNCTIONS . 'cost_weight_table.php');
    $display_table = display_table();
    
              //$shipping_method = MODULE_SHIPPING_PWTABLE_TEXT_WAY . ' ' . '<br>' . MODULE_SHIPPING_PWTABLE_TEXT_AMOUNT . ':' . $currency_symbol . $order_total . ',   ' . MODULE_SHIPPING_PWTABLE_TEXT_WEIGHT . ':' . $total_weight . ' ' . MODULE_SHIPPING_PWTABLE_TEXT_UNITS;
              $shipping_method = MODULE_SHIPPING_PWTABLE_TEXT_WAY . ' ' . '<br>' . MODULE_SHIPPING_PWTABLE_TEXT_AMOUNT . ':' . $order_total. ' '.$currency_symbol ;
    
    
    
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_PWTABLE_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                        'title' => $shipping_method,
                                                        'table' => $display_table,
                                                         'cost' => $shipping + MODULE_SHIPPING_PWTABLE_HANDLING)));
    
          if ($this->tax_class > 0) {
            $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
          }
    
          if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
    
          return $this->quotes;
        }
    
        function check() {
          if (!isset($this->_check)) {
            $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_PWTABLE_STATUS'");
            $this->_check = tep_db_num_rows($check_query);
          }
          return $this->_check;
        }
    
        function install() {
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_PWTABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Cost Bands', 'MODULE_SHIPPING_PWTABLE_COSTTABLE', '30.00,125.00,350.00,750.00,1500.00,3000.00', 'These are the six cost bands. For each of these bands, there are six weight:shipping-charge rates (See below). Shipping charge is therefore based on price/weight of the cart.', '6', '0', now())");
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight/Shipping Band 0', 'MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_0', '0.5:1.99,5.0:5.49,10.0:5.99,20.0:6.49,50.0:7.49,100.0:8.49', 'Rates for cost band 0. The shipping charge is based on the cost band(£30.00 in this case) + the six cart weights. Eg. 0.5:1.99 means for cart amount less than £30.00 and cart weight less than 0.5 kg, the shipping charge would be £1.99 etc.', '6', '0', now())");
    
    
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight/Shipping Band 1', 'MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_1', '0.5:3.29,5.0:4.49,10.0:5.59,20.0:5.79,50.0:5.99,100.0:6.99', 'Rates for cost band 1. The shipping charge is based on the cost band(£125.00 in this case) + the six cart weights. Eg. 5.0:4.49 means for cart amount less than £125.00 and cart weight less than 5.0 kg, the shipping charge would be £4.49 etc.', '6', '0', now())");
    
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight/Shipping Band 2', 'MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_2', '0.5:4.99,5.0:4.99,10.0:4.99,20.0:4.99,50.0:5.99,100.0:6.99', 'Rates for cost band 2. The shipping charge is based on the cost band(£350.00 in this case) + the six cart weights. Eg. 10.0:4.99 means for cart amount less than £350.00 and cart weight less than 10.0 kg, the shipping charge would be £4.99 etc.', '6', '0', now())");
    
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight/Shipping Band 3', 'MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_3', '0.5:4.99,5.0:4.99,10.0:4.99,20.0:4.99,50.0:5.99,100.0:6.99', 'Rates for cost band 3. The shipping charge is based on the cost band(£750.00 in this case) + the six cart weights. Eg. 20.0:4.99 means for cart amount less than £750.00 and cart weight less than 20.0 kg, the shipping charge would be £4.99 etc.', '6', '0', now())");
    
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight/Shipping Band 4', 'MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_4', '0.5:3.99,5.0:3.99,10.0:4.49,20.0:4.99,50.0:4.99,100.0:5.99', 'Rates for cost band 4. The shipping charge is based on the cost band(£1500.00 in this case) + the six cart weights. Eg. 50.0:4.99 means for cart amount less than £1500.00 and cart weight less than 50.0 kg, the shipping charge would be £4.99 etc.', '6', '0', now())");
    
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight/Shipping Band 5', 'MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_5', '0.5:3.99,5.0:3.99,10.0:4.49,20.0:4.99,50.0:4.99,100.0:5.99', 'Rates for cost band 5. The shipping charge is based on the cost band(£3000.00 in this case) + the six cart weights. Eg. 100.0:5.99 means for cart amount less than £3000.00 and cart weight less than 100.0 kg, the shipping charge would be £5.99 etc.', '6', '0', now())");
    
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_PWTABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
          
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_PWTABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_PWTABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
        }
    
        function remove() {
          tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
        }
    
        function keys() {
          return array('MODULE_SHIPPING_PWTABLE_STATUS','MODULE_SHIPPING_PWTABLE_COSTTABLE','MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_0','MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_1','MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_2','MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_3','MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_4','MODULE_SHIPPING_PWTABLE_WEIGHTTABLE_5','MODULE_SHIPPING_PWTABLE_SORT_ORDER', 'MODULE_SHIPPING_PWTABLE_ZONE','MODULE_SHIPPING_PWTABLE_HANDLING', 'MODULE_SHIPPING_PWTABLE_TAX_CLASS');
        }
      }
    ?>
    Für Hilfe bin ich dankbar.
    Gruss.

    #2
    werde mal schauen ob ich morgen oder über das WE zeit habe diesen modul zu porten...

    Hasst du den link zum contrib?

    Kommentar


      #3
      Versandmodul pwtable

      Hallo Eentje

      Wäre wunderbar, wenn es klappt.
      hier der Link auf die OSCommerce Contrib
      :
      http://addons.oscommerce.com/info/1764

      Bedankt!

      Kommentar


        #4
        Hier ist es... bei mir geht es wunderbar....

        Kommentar


          #5
          Danke!

          Lieber Eentje

          Hervorragend! herzlichen Dank für die schnelle und gute Anpassung.

          Ein kleines Detail:
          - Wenn ich als Shipping Zone "ALL" auswähle, lädt das Modul nicht mehr in der Übersicht "Module/Versandarten"

          Ist das nur bei mir so?

          Gruss.

          Kommentar


            #6
            Shippingzone ALL muss man auch nicht benutzen... Wähle dann --kein--

            Kommentar


              #7
              genau so hab ichs auch gemacht.
              thanx.

              Kommentar


                #8
                und wenn ich das nun ausversehen doch ausgewählt habe aber die seite der bezahlmethode nicht mehr läd? Wie kann ich das rückgängig machen. Fehlen sql daten.

                Kommentar


                  #9
                  priceweight ist ein versandmodul kein zahlungsmodul...

                  Kommentar


                    #10
                    oh war ich wo anders schon wieder abgesehen davon weiss trotzdem jeder worum es geht oder was...also wenig hilfreich dein berichtigungskommentar aber trotzdem danke...weiterhin die frage des weges einer lösung bleibt bestehen.

                    vielleicht diesmal ein hilfreicher beitrag

                    Kommentar


                      #11
                      Dann bitte deine Frage als neuer Thread starten und genau erklären was wo wie schief geht.

                      Kommentar


                        #12
                        Die Frage bleibt die selbe und ist im genau richtigem Thread! Es geht um das modul...vergiss es ich werde mich selber darum kümmern.

                        Dankjewel
                        fijne avond

                        Kommentar


                          #13
                          und btw. was ist ein eentje? meinst du eine ente? dann bitte eendje oder soll das einste bedeuten? XDDD

                          doei

                          Kommentar

                          Info zu diesem Forenarchiv:
                          Mit Release von 1.5.7 wurde die deutsche Zen Cart Version auf eine reine DIY-Lösung umgestellt.
                          Für einen Support via Forum stehen keine personellen und zeitlichen Ressourcen mehr zur Verfügung.
                          Dieses Supportforum bleibt im Nur-Lesen-Modus als Wissensarchiv noch online verfügbar.
                          PM Funktionalität, Registrierung und Posten neuer Beiträge sind deaktiviert.
                          Zugriff auf Anhänge in den Postings ist auch ohne Registrierung/Einloggen möglich.
                          FAQ und Downloadbereich des Forums wurden in die neue umfangreiche Knowledgebase auf der zen-cart-pro.at Website übernommen.

                          Das Development der deutschen Zen Cart Version geht wie bisher auf Github weiter.
                          Wir werden auch weiterhin neue Versionen bereitstellen und die Onlinedokumentation/Knowledgebase aktualisieren.
                          Fehler in der Software können auf Github als Issues gemeldet werden.
                          Follow us
                          aktuelle version
                          Zen Cart 1.5.7 deutsch
                          vom 20.05.2022
                          [Download]
                          Lädt...
                          X