Index: /controller/wpsg_BasketController.class.php
===================================================================
--- /controller/wpsg_BasketController.class.php	(revision 8017)
+++ /controller/wpsg_BasketController.class.php	(revision 8018)
@@ -57,4 +57,6 @@
 			}
 			
+			$this->shop->checkCustomerPresetCountry();
+			
 			// Basket aus Session zusammenbauen
 			$this->shop->basket->initFromSession(true);
@@ -253,4 +255,6 @@
 
 			if (!isset($this->_outputCache['overview'])) {
+				
+				$this->shop->checkCustomerPresetCountry();
 				
 				$this->shop->basket->initFromSession();
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 8017)
+++ /controller/wpsg_ShopController.class.php	(revision 8018)
@@ -1913,4 +1913,22 @@
 		/**
 		 * Checkt und setzt die Kundenvorgaben in der Session, sollte nichts eingetragen sein
+		 * Nur Land 
+		 */
+		public function checkCustomerPresetCountry() {
+
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['land']) && wpsg_isSizedString($this->get_option('wpsg_defaultland'))) {
+
+				$_SESSION['wpsg']['checkout']['land'] = $this->get_option('wpsg_defaultland');
+				
+				$this->basket->arCheckout['land'] = $_SESSION['wpsg']['checkout']['land']; 
+				
+				if (isset($this->view['basket'])) $this->view['basket']['checkout']['land'] = $_SESSION['wpsg']['checkout']['land'];
+								
+			}
+			
+		}
+		
+		/**
+		 * Checkt und setzt die Kundenvorgaben in der Session, sollte nichts eingetragen sein
 		 * Setzt auch die Variablen fÃŒr das Template
 		 *
@@ -1919,12 +1937,4 @@
 		public function checkCustomerPreset() {
  
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['land']) && wpsg_isSizedString($this->get_option('wpsg_defaultland'))) {
-
-				$_SESSION['wpsg']['checkout']['land'] = $this->get_option('wpsg_defaultland');
-				
-				if (isset($this->view['basket'])) $this->view['basket']['checkout']['land'] = $_SESSION['wpsg']['checkout']['land'];
-
-			}
-			
 			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping']) && wpsg_isSizedString($this->get_option('wpsg_customerpreset_shipping')) && sizeof($_SESSION['wpsg']['basket']??[]) > 0) {
 
@@ -1937,5 +1947,15 @@
 					foreach ($this->arShipping as $shipping_key => $shipping_data) {
 						
-						$cost = $oCalculation->calculateCostKey($shipping_data['price']);
+						if ($shipping_data['sub']) {
+							
+							$cost = 0;
+							
+							foreach ($shipping_data['sub'] as $sub_key => $sub_data) {
+							
+								$cost += $oCalculation->calculateCostKey($sub_data['price']);
+								
+							}
+							
+						} else $cost = $oCalculation->calculateCostKey($shipping_data['price']);
 					 
 						if ($cost < $min_shipping_cost || $min_shipping_cost === null) {
@@ -1949,5 +1969,7 @@
 					
 					if ($min_shipping_key !== null) {
-						 
+						  
+						$this->basket->arCheckout['shipping'] = $min_shipping_key;
+						
 						$_SESSION['wpsg']['checkout']['shipping'] = $min_shipping_key;
 						$oCalculation->update();
@@ -1957,4 +1979,6 @@
 				} else if (isset($this->arShipping[$this->get_option('wpsg_customerpreset_shipping')])) {
 				
+					$this->basket->arCheckout['shipping'] = $this->get_option('wpsg_customerpreset_shipping');
+					
 					$_SESSION['wpsg']['checkout']['shipping'] = $this->get_option('wpsg_customerpreset_shipping');
 					$oCalculation->update();
@@ -1969,10 +1993,11 @@
 				if (!array_key_exists($_SESSION['wpsg']['checkout']['shipping'], $this->arShipping) && sizeof($this->arShipping) > 0) {
 				 
+					$this->basket->arCheckout['shipping'] = array_keys($this->arShipping)[0];;
+					
 					$_SESSION['wpsg']['checkout']['shipping'] = array_keys($this->arShipping)[0];
 
 					$oCalculation = \wpsg\wpsg_calculation::getSessionCalculation();
 					$oCalculation->update();											
-					
-					
+										
 				}
 				
@@ -1991,5 +2016,23 @@
 					foreach ($this->arPayment as $paymnet_key => $payment_data) {
 						
-						$cost = $oCalculation->calculateCostKey($payment_data['price']);
+						try {
+							
+							if ($payment_data['sub']) {
+								
+								$cost = 0;
+								
+								foreach ($payment_data['sub'] as $sub_key => $sub_data) {
+								
+									$cost += $oCalculation->calculateCostKey($sub_data['price']);
+									
+								}
+								
+							} else $cost = $oCalculation->calculateCostKey($payment_data['price']);
+
+						} catch (\Exception $e) {
+							
+							$cost = 0;
+							
+						}
 					 
 						if ($cost < $min_payment_cost || $min_payment_cost === null) {
@@ -2003,6 +2046,8 @@
 					
 					if ($min_payment_key !== null) {
-						 
+						
 						$_SESSION['wpsg']['checkout']['payment'] = $min_payment_key;
+						$this->basket->arCheckout['payment'] = $min_payment_key;
+						
 						$oCalculation->update();
 						
@@ -2011,5 +2056,7 @@
 				} else {
 				
-					$_SESSION['wpsg']['checkout']['payment'] = $this->get_option('wpsg_customerpreset_payment');					
+					$_SESSION['wpsg']['checkout']['payment'] = $this->get_option('wpsg_customerpreset_payment');
+					$this->basket->arCheckout['payment'] = $this->get_option('wpsg_customerpreset_payment');
+					
 					$oCalculation->update();
 					
@@ -2024,4 +2071,6 @@
 					
 					$_SESSION['wpsg']['checkout']['payment'] = array_keys($this->arPayment)[0];
+					$this->basket->arCheckout['payment'] = array_keys($this->arPayment)[0];
+					
 					$oCalculation->update();
 											
@@ -2035,4 +2084,6 @@
 
 				$_SESSION['wpsg']['checkout']['title'] = $this->get_option('wpsg_customerpreset_title');
+				$this->basket->arCheckout['title'] = $this->get_option('wpsg_customerpreset_title');
+				
 				if (isset($this->view['basket'])) $this->view['basket']['checkout']['title'] = $_SESSION['wpsg']['checkout']['land'];
 
@@ -4709,4 +4760,6 @@
 			$arShippingNew = array();
 
+			$this->callMods('checkShippingAvailable_pre', array(&$this->arShipping));
+			
 			// Damit es auch ohne View aus wpsg_basket.class beim prÃŒfen der Versandarten aufgerufen werden kann
 			if (!wpsg_isSizedArray($this->view['basket'])) $this->view['basket'] = $this->basket->toArray();
Index: /lib/filter_functions.inc.php
===================================================================
--- /lib/filter_functions.inc.php	(revision 8017)
+++ /lib/filter_functions.inc.php	(revision 8018)
@@ -413,7 +413,5 @@
                 'host' => $_SERVER['HTTP_HOST'],
                 'data' => $arParam
-            ), 5);
-                     
-            //die(var_dump($api_return));
+            ), 5); 
                            
         } catch (\Exception $e) {
Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 8017)
+++ /lib/wpsg_calculation.class.php	(revision 8018)
@@ -1380,5 +1380,5 @@
 			else if ($typ === 'g') $value = $this->dWeight; // Gewicht
 			else { 
-				
+				die(debug_print_backtrace());
 				throw new \Exception(wpsg_translate(__('Typ (#1#) fÃŒr KostenschlÃŒssel nicht definiert.', 'wpsg'), $typ)); 
 			
Index: /model/wpsg_country.class.php
===================================================================
--- /model/wpsg_country.class.php	(revision 8017)
+++ /model/wpsg_country.class.php	(revision 8018)
@@ -37,4 +37,10 @@
 				
 		} // public function getShorttext()
+		
+		public function getShippingZoneId() /* :int */ {
+			
+			return intval($this->__get('vz'));
+			
+		}
 		
 		/**
Index: /mods/mod_converter/M1_Converter_update.php
===================================================================
--- /mods/mod_converter/M1_Converter_update.php	(revision 8017)
+++ /mods/mod_converter/M1_Converter_update.php	(revision 8018)
@@ -963,5 +963,5 @@
 						} else {
 							
-							$from = WPSG_PATH_CONTENT.'uploads/wpsg_pdfprodukte/';
+							$from = WPSG_PATH_CONTENT.'uploads/wpsg_downloadprodukte/';
 							$to = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_pdfprodukte/';
 							
Index: /mods/mod_converter/M1_progressbar.class.php
===================================================================
--- /mods/mod_converter/M1_progressbar.class.php	(revision 8017)
+++ /mods/mod_converter/M1_progressbar.class.php	(revision 8018)
@@ -58,5 +58,5 @@
 		if(empty($init_printed))
 		{
-			self::execute_js("var {$jsp}bs=[];var {$jsp}ds=[];var {$jsp}ss=[];var {$jsp}ws=[];var {$jsp}dc=[];function {$jsp}s(f,d){var e=(d/{$jsp}ss[f]);if({$jsp}ds[f]){{$jsp}ds[f].innerHTML=\"\"+Math.round(e*100)+\" %\";}{$jsp}bs[f].style.width=\"\"+Math.round(e*{$jsp}ws[f])+\"px\";var c=(e>=0.5);if({$jsp}ds[f]&&{$jsp}dc[f]!=c){var a=(c?document.getElementById(\"{$jsp}b\"+f):{$jsp}bs[f]);{$jsp}ds[f].style.color=a.style.backgroundColor;{$jsp}dc[f]=c}}function {$jsp}i(e,d,a,b){{$jsp}bs[e]=document.getElementById(\"{$jsp}\"+e);{$jsp}ds[e]=document.getElementById(\"{$jsp}d\"+e);{$jsp}dc[e]=false;{$jsp}ss[e]=a;{$jsp}ws[e]=b;{$jsp}s(e,d)};", false);
+			self::execute_js("var {$jsp}bs=[];var {$jsp}ds=[];var {$jsp}ss=[];var {$jsp}ws=[];var {$jsp}dc=[];function {$jsp}s(f,d){var e=(d/{$jsp}ss[f]);if({$jsp}ds[f]){{$jsp}ds[f].innerHTML=\"\"+Math.round(e*100)+\" %\";}{$jsp}bs[f].style.width=\"\"+Math.round(e*{$jsp}ws[f])+\"px\";var c=(e>=0.5);if({$jsp}ds[f]&&{$jsp}dc[f]!=c){var a=(c?do cument.getElementById(\"{$jsp}b\"+f):{$jsp}bs[f]);{$jsp}ds[f].style.color=a.style.backgroundColor;{$jsp}dc[f]=c}}function {$jsp}i(e,d,a,b){{$jsp}bs[e]=document.getElementById(\"{$jsp}\"+e);{$jsp}ds[e]=document.getElementById(\"{$jsp}d\"+e);{$jsp}dc[e]=false;{$jsp}ss[e]=a;{$jsp}ws[e]=b;{$jsp}s(e,d)};", false);
 			$init_printed = true;
 		}
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 8017)
+++ /mods/wpsg_mod_basic.class.php	(revision 8018)
@@ -609,4 +609,6 @@
 		public function customer_created(&$customer_id, &$pwd) { }
 		
+		public function checkShippingAvailable_pre(&$arShipping) { }
+		
 		/**
 		 * ÃberprÃŒft die Versandarten ob sie bei dem ÃŒbergebenen Warenkorb mÃ¶glich sind
Index: /mods/wpsg_mod_paypalapi.class.php
===================================================================
--- /mods/wpsg_mod_paypalapi.class.php	(revision 8017)
+++ /mods/wpsg_mod_paypalapi.class.php	(revision 8018)
@@ -1048,5 +1048,5 @@
 			{
 				
-				if ($payment_id != $this->id)
+				if (strval($payment_id) != strval($this->id))
 				{
 					 
Index: /mods/wpsg_mod_versandarten.class.php
===================================================================
--- /mods/wpsg_mod_versandarten.class.php	(revision 8017)
+++ /mods/wpsg_mod_versandarten.class.php	(revision 8018)
@@ -251,4 +251,28 @@
 			
 		} // public function be_ajax()
+		 
+		public function checkShippingAvailable_pre(&$arShipping) { 
+			
+			if (wpsg_isSizedInt($_SESSION['wpsg']['checkout']['shipping_land'])) $land = intval($_SESSION['wpsg']['checkout']['shipping_land']);
+			else if (wpsg_isSizedInt($_SESSION['wpsg']['checkout']['land'])) $land = intval($_SESSION['wpsg']['checkout']['land']);
+			else return;
+			
+			$oLand = wpsg_country::getInstance($land);
+			
+			if ($oLand->getShippingZoneId() > 0) {
+				
+				foreach ($arShipping as $shipping_key => $shipping_data) {
+					
+					if (preg_match('/'.$this->id.'_\d+/', $shipping_key)) {
+						
+						if ($shipping_data['vz'] !== $oLand->getShippingZoneId()) unset($arShipping[$shipping_key]);
+						
+					}
+					
+				}
+
+			}
+			
+		}
 		
 		public function addShipping(&$arShipping, $va_active = false) {
@@ -265,7 +289,7 @@
 				if ($land !== false) {
 					
-					$vz = $this->db->fetchOne("SELECT `vz` FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($land)."'");
-					
-					$strQueryWHERE .= " AND (`vz` <= 0 OR `vz` = '".wpsg_q($vz)."') ";
+					//$vz = $this->db->fetchOne("SELECT `vz` FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($land)."'");
+					
+					//$strQueryWHERE .= " AND (`vz` <= 0 OR `vz` = '".wpsg_q($vz)."') ";
 					
 				} /* else $strQueryWHERE .= " AND (`vz` <= 0) "; */
@@ -303,4 +327,5 @@
 				
 				$arShipping[$this->id.'_'.$va['id']] = array(
+					'vz' => intval($va['vz']),
 					'active' => $va['aktiv'],
 					'id' => $this->id.'_'.$va['id'],
