-fast gelöst- Versandoptionen werden unterdrückt

Johnson

Aktives Mitglied
25. Oktober 2006
30
0
Hallo Nochmal

Im Shop werden Versandgebühren separat aufgeführt.
Nach dem letzten Artikel folgt die Versandart + entsprechende Gebühr.
Allfällige Nachnahmegebüren werden darunter separat aufgeführt, beim Import in eS aber leider unterdrückt.

Ach ja: eS0984 & osc- connector v0.996.
 

Johnson

Aktives Mitglied
25. Oktober 2006
30
0
Hallo
Folgende Contrib wird für Nachnahme verwendet:
http://www.oscommerce.com/community/contributions,4348/category,all/search,nachnahme
Code:
<?php
/*
  $Id: nachnahme.php,v 1.0 2006/06/25 13:05:31 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  [url]http://www.oscommerce.com[/url]

  Copyright (c) 2003 osCommerce
 
  Created by Lukas Havranek - [url]www.LED-Store.ch[/url]

  Released under the GNU General Public License
*/

  class nachnahme {
    var $code, $title, $description, $enabled;

// class constructor
    function nachnahme() {
      global $order;

      $this->code = 'nachnahme';
      $this->title = MODULE_PAYMENT_NACHNAHME_TEXT_TITLE;
      $this->description = MODULE_PAYMENT_NACHNAHME_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_PAYMENT_NACHNAHME_SORT_ORDER;
      $this->enabled = ((MODULE_PAYMENT_NACHNAHME_STATUS == 'True') ? true : false);

      if ((int)MODULE_PAYMENT_NACHNAHME_ORDER_STATUS_ID > 0) {
        $this->order_status = MODULE_PAYMENT_NACHNAHME_ORDER_STATUS_ID;
      }

      if (is_object($order)) $this->update_status();
      $this->email_footer = MODULE_PAYMENT_NACHNAHME_TEXT_EMAIL_FOOTER;
    }

// class methods
function update_status() {
global $order, $shipping, $currency;


      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_NACHNAHME_ZONE > 0) ) {
        $check_flag = false;
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NACHNAHME_ZONE . "' and zone_country_id = '" . $order->billing['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->billing['zone_id']) {
            $check_flag = true;
            break;
          }
        }

        if ($check_flag == false) {
          $this->enabled = false;
        }
      }

// Deaktivieren wenn Währung nicht Standardwährung
if ($currency != DEFAULT_CURRENCY) {
$this->enabled = false;
}

// Deaktivieren wenn Lieferadresse nicht CH
//if ($order->delivery['country_id'] != "204") {
//$this->enabled = false;
//}

// Deaktivieren wenn Versandkostenfrei
//if ($shipping['id']=="free_free") {
//$this->enabled = false;
//}

    }

    function javascript_validation() {
      return false;
    }

    function selection() {
      return array('id' => $this->code,
                   'module' => $this->title);
    }

    function pre_confirmation_check() {
      return false;
    }

    function confirmation() {
      return array('title' => MODULE_PAYMENT_NACHNAHME_TEXT_DESCRIPTION);
    }

    function process_button() {
      return false;
    }

    function before_process() {
      return false;
    }

    function after_process() {
      return false;
    }

    function get_error() {
      return false;
    }

    function check() {
      if (!isset($this->_check)) {
        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NACHNAHME_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 ('Aktiviere Nachnahme Modul', 'MODULE_PAYMENT_NACHNAHME_STATUS', 'True', 'Möchten Sie die Bezahlung via Nachnahme akzeptieren?', '6', '1', '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 ('Sortierung', 'MODULE_PAYMENT_NACHNAHME_SORT_ORDER', '0', 'Reihenfolge für die Zahlungsmöglichkeiten. (Die kleinste Nummer kommt als erstes)', '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 ('Zone', 'MODULE_PAYMENT_NACHNAHME_ZONE', '0', 'Wählen Sie für welche Zone dieses Modul aktiviert werden soll.', '6', '2', '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, set_function, use_function, date_added) values ('Status der Bestellung', 'MODULE_PAYMENT_NACHNAHME_ORDER_STATUS_ID', '0', 'Wählen Sie den Status den Sie per default gesetzt haben möchten.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
    }

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

    function keys() {
      return array('MODULE_PAYMENT_NACHNAHME_STATUS', 'MODULE_PAYMENT_NACHNAHME_ZONE', 'MODULE_PAYMENT_NACHNAHME_ORDER_STATUS_ID', 'MODULE_PAYMENT_NACHNAHME_SORT_ORDER');
    }
  }
?>

Das sieht dann im Shop so aus:
http://www.gassner-online.ch/download/nachnahme.jpg

Versandkosten werden importiert, Nachnahme nicht.
 
Zuletzt von einem Moderator bearbeitet:

xtwin

Aktives Mitglied
13. November 2006
45
0
Niederhasli, Schweiz
Ich dopple nach mit dem Nachname-Modul von XT:C 3.0.4sp21

Code:
<?php

/* -----------------------------------------------------------------------------------------
   $Id: cod.php 1003 2005-07-10 18:58:52Z mz $   

   XT-Commerce - community made shopping
   [url]http://www.xt-commerce.com[/url]

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

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

class cod {

	var $code, $title, $description, $enabled;

	function cod() {
		global $order,$xtPrice;

		$this->code = 'cod';
		$this->title = MODULE_PAYMENT_COD_TEXT_TITLE;
		$this->description = MODULE_PAYMENT_COD_TEXT_DESCRIPTION;
		$this->sort_order = MODULE_PAYMENT_COD_SORT_ORDER;
		$this->enabled = ((MODULE_PAYMENT_COD_STATUS == 'True') ? true : false);
 		$this->info = MODULE_PAYMENT_COD_TEXT_INFO;
		$this->cost;

		if ((int) MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
			$this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID;
		}

		if (is_object($order))
			$this->update_status();
	}

	function update_status() {
		global $order;
		if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') {
			$this->enabled = false;
		}
		if (($this->enabled == true) && ((int) MODULE_PAYMENT_COD_ZONE > 0)) {
			$check_flag = false;
			$check_query = xtc_db_query("select zone_id from ".TABLE_ZONES_TO_GEO_ZONES." where geo_zone_id = '".MODULE_PAYMENT_COD_ZONE."' and zone_country_id = '".$order->delivery['country']['id']."' order by zone_id");
			while ($check = xtc_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;
			}
		}

	}

	function javascript_validation() {
		return false;
	}

	function selection() {
		global $xtPrice,$order;
		
      if (MODULE_ORDER_TOTAL_COD_FEE_STATUS == 'true') {


        $cod_country = false;

          //process installed shipping modules
          if ($_SESSION['shipping']['id'] == 'flat_flat') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
          if ($_SESSION['shipping']['id'] == 'item_item') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
          if ($_SESSION['shipping']['id'] == 'table_table') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
          if ($_SESSION['shipping']['id'] == 'zones_zones') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
          if ($_SESSION['shipping']['id'] == 'ap_ap') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_AP);
          if ($_SESSION['shipping']['id'] == 'dp_dp') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DP);


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


          if ($_SESSION['shipping']['id'] == 'chronopost_chronopost') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST);


          if ($_SESSION['shipping']['id'] == 'dhl_ECX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
          if ($_SESSION['shipping']['id'] == 'dhl_DOX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
          if ($_SESSION['shipping']['id'] == 'dhl_SDX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
          if ($_SESSION['shipping']['id'] == 'dhl_MDX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
          if ($_SESSION['shipping']['id'] == 'dhl_WPX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);

          if ($_SESSION['shipping']['id'] == 'ups_ups') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_UPS);
          if ($_SESSION['shipping']['id'] == 'upse_upse') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_UPSE);

 
          if ($_SESSION['shipping']['id'] == 'free_free') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FREE);
          if ($_SESSION['shipping']['id'] == 'freeamount_freeamount') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_FREEAMOUNT_FREE);


            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) {
            $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) {

            $cod_cost_value=$cod_cost;
            $cod_cost= $xtPrice->xtcFormat($cod_cost,true);
        }
        if (!$cod_cost_value) {
           $cod_cost_value=$cod_cost;
           $cod_cost= $xtPrice->xtcFormat($cod_cost,true);
        }
        $this->cost = '+ '.$cod_cost;

        
      }
		
		
		return array ('id' => $this->code, 'module' => $this->title, 'description' => $this->info,'module_cost'=>$this->cost);
	}

	function pre_confirmation_check() {
		return false;
	}

	function confirmation() {
		return false;
	}

	function process_button() {
		return false;
	}

	function before_process() {
		return false;
	}

	function after_process() {
		global $insert_id;
		if ($this->order_status)
			xtc_db_query("UPDATE ".TABLE_ORDERS." SET orders_status='".$this->order_status."' WHERE orders_id='".$insert_id."'");

	}

	function get_error() {
		return false;
	}

	function check() {
		if (!isset ($this->_check)) {
			$check_query = xtc_db_query("select configuration_value from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_PAYMENT_COD_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_PAYMENT_COD_STATUS', 'True',  '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_PAYMENT_COD_ALLOWED', '', '6', '0', now())");
		xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value,  configuration_group_id, sort_order, use_function, set_function, date_added) values ('MODULE_PAYMENT_COD_ZONE', '0', '6', '2', 'xtc_get_zone_class_title', 'xtc_cfg_pull_down_zone_classes(', now())");
		xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_COD_SORT_ORDER', '0',  '6', '0', now())");
		xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value,  configuration_group_id, sort_order, set_function, use_function, date_added) values ('MODULE_PAYMENT_COD_ORDER_STATUS_ID', '0','6', '0', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now())");
	}

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

	function keys() {
		return array ('MODULE_PAYMENT_COD_STATUS', 'MODULE_PAYMENT_COD_ALLOWED', 'MODULE_PAYMENT_COD_ZONE', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', 'MODULE_PAYMENT_COD_SORT_ORDER');
	}
}
?>
 

Johnson

Aktives Mitglied
25. Oktober 2006
30
0
Keine Lösung in Sicht?
Unterdessen sind bereits Nachnahmegebühren bei der Verrechung untergegangen.
Den Kunden freut's, mich weniger... :evil:
 

Thomas Lisson

Administrator
Mitarbeiter
24. März 2006
15.574
299
Köln
Hallo,

Doch, ist nur untergegangen.

Wir brauchen für die Implementierung noch eine Information:
Schaut in der ShopDB in die Tabelle orders_total. Schaut Euch dort die Datensätze, wo in der Spalte "title" die jeweilige Zahlungsart steht.
Von diesen Datensätzen brauchen wir den Namen in der Spalte "class".

Das könnt ihr uns poten, dann wirds zügüg implementiert.

So schaut der Datensatz etwa bei XTC Standardnachnahmegebühr aus:
Code:
 orders_total_id   	  orders_id   	  title   	  text   	  value   	  class   	  sort_order
176  	44  	Nachnahmegeb&uuml;hr:  	 4,00 EUR  	4.0000  	ot_cod_fee  	35
 

Johnson

Aktives Mitglied
25. Oktober 2006
30
0
Hallo.
Hier meine Zeile:
Code:
49|18|Nachnahme-Gebühren:|CHF 15.00|15.0000|ot_modul_spesen|2
Besten Dank schon im Voraus.
Gruss
- Johnson
 

Thomas Lisson

Administrator
Mitarbeiter
24. März 2006
15.574
299
Köln
H_allo Johnson,

hier die Lösung.
Ersetze die Datei dbeS/GetBestellungPos.php komplett durch folgenden Code:

Code:
<?php
/**
 * eazySales_Connector/dbeS/GetBestellungPos.php
 * Synchronisationsscript
 * 
 * Es gelten die Nutzungs- und Lizenzhinweise unter [url]http://www.jtl-software.de/eazysales.php[/url]
 * 
 * @author JTL-Software <thomas@jtl-software.de>
 * @copyright 2006, JTL-Software
 * @link [url]http://jtl-software.de/eazysales.php[/url]
 * @version v1.03 / 19.12.06
*/

require_once("syncinclude.php");

$return=3;
if (auth())
{
	$return=5;
	if (intval($_POST['KeyBestellung']))
	{
		//glob einstellungen
		$cur_query = eS_execute_query("select versandMwst,tax_zone_id from eazysales_einstellungen");
		$einstellungen = mysql_fetch_object($cur_query);
		
		$return = 0;		
		//hole orderposes
		$cur_query = eS_execute_query("select * from orders_products where orders_id=".intval($_POST['KeyBestellung'])." order by orders_products_id");
		while ($BestellungPos = mysql_fetch_object($cur_query))
		{
			//mappe bestellpos
			$kBestellPos = setMappingBestellPos($BestellungPos->orders_products_id);
			echo(CSVkonform($kBestellPos).';');
			echo(CSVkonform(intval($_POST['KeyBestellung'])).';');
			echo(CSVkonform(getEsArtikel($BestellungPos->products_id)).';');
			echo(CSVkonform($BestellungPos->products_name).';');
			echo(CSVkonform($BestellungPos->products_price*(100+$BestellungPos->products_tax)/100).';');
			echo(CSVkonform($BestellungPos->products_tax).';');
			echo(CSVkonform($BestellungPos->products_quantity).';');
			echo("\n");
		}
		//letzte Positionen wie Versand, Mindermengenzuschlag, Rabatt, Kupon etc.
		$cur_query = eS_execute_query("select * from orders_total where (class=\"ot_shipping\" OR class=\"ot_cod_fee\" OR class=\"ot_coupon\" OR class=\"ot_discount\" OR class=\"ot_gv\" OR class=\"ot_loworderfee\" OR class=\"ot_ps_fee\" OR class=\"ot_modul_spesen\") and orders_id=".intval($_POST['KeyBestellung'])." order by sort_order");
		while ($total_pos = mysql_fetch_object($cur_query))
		{
			if ($total_pos->class=="ot_shipping" || $total_pos->value!=0)
			{
				//mappe bestellpos
				$kBestellPos = setMappingBestellPos(0);
	
				$steuersatz = 0;
				switch ($total_pos->class)
				{
					case 'ot_shipping':
						//hole versand mwst aus einstellungen 
						$steuersatz = $einstellungen->versandMwst;
						break;
					case 'ot_cod_fee':
						$tax_query = eS_execute_query("select configuration_value from configuration where configuration_key=\"MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS\"");
						$tax_class = mysql_fetch_object($tax_query);
						if ($tax_class->configuration_value>0)
							$steuersatz = get_tax($tax_class->configuration_value);
						break;
					case 'ot_coupon':
						$tax_query = eS_execute_query("select configuration_value from configuration where configuration_key=\"MODULE_ORDER_TOTAL_COUPON_TAX_CLASS\"");
						$tax_class = mysql_fetch_object($tax_query);
						if ($tax_class->configuration_value>0)
							$steuersatz = get_tax($tax_class->configuration_value);
						break;
					case 'ot_gv':
						$tax_query = eS_execute_query("select configuration_value from configuration where configuration_key=\"MODULE_ORDER_TOTAL_GV_TAX_CLASS\"");
						$tax_class = mysql_fetch_object($tax_query);
						if ($tax_class->configuration_value>0)
							$steuersatz = get_tax($tax_class->configuration_value);
						break;
					case 'ot_loworderfee':
						$tax_query = eS_execute_query("select configuration_value from configuration where configuration_key=\"MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS\"");
						$tax_class = mysql_fetch_object($tax_query);
						if ($tax_class->configuration_value>0)
							$steuersatz = get_tax($tax_class->configuration_value);
						break;				
					case 'ot_ps_fee':
						$tax_query = eS_execute_query("select configuration_value from configuration where configuration_key=\"MODULE_ORDER_TOTAL_PS_FEE_TAX_CLASS\"");
						$tax_class = mysql_fetch_object($tax_query);
						if ($tax_class->configuration_value>0)
							$steuersatz = get_tax($tax_class->configuration_value);
						break;
					case 'ot_modul_spesen':
						//$steuersatz = $einstellungen->versandMwst;
						break;
				}
				echo(CSVkonform($kBestellPos).';');
				echo(CSVkonform(intval($_POST['KeyBestellung'])).';');
				echo(CSVkonform("0").';');
				echo(CSVkonform(unhtmlentities($total_pos->title)).';');
				echo(CSVkonform(unhtmlentities($total_pos->value)).';');
				echo(CSVkonform($steuersatz).';');
				echo(CSVkonform("1").';');
				echo("\n");
			}
		}
	}
}
mysql_close();
echo($return);
logge($return);
?>

Die Nachnahmegebühren werden ohne MwSt eingelesen. Willst Du, dass sie mit MwSt eingelesen werden sollen, machst Du aus Zeile 89
Code:
						//$steuersatz = $einstellungen->versandMwst;
das hier
Code:
						$steuersatz = $einstellungen->versandMwst;
 

Johnson

Aktives Mitglied
25. Oktober 2006
30
0
Mit dem neusten Connector funktionierts wieder nicht.
Muss ich die Änderung jetzt bei jedem Update neu einpflegen?
 
Ähnliche Themen
Titel Forum Antworten Datum
[GELÖST] Wawi startet nicht mehr. Dringendes Problem! JTL-Wawi 1.9 2

Ähnliche Themen