Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 7241)
+++ /lib/wpsg_calculation.class.php	(revision 7242)
@@ -68,4 +68,6 @@
         public function addCountry($country_id, $tax_mode, $tax_a, $tax_b, $tax_c, $tax_d, $default = true) {
             
+        	if (!wpsg_isSizedInt($country_id)) $country_id = $this->shop->getDefaultCountry(true);
+        	
         	if (array_key_exists($country_id, $this->arCountry)) return; 
         	
@@ -85,4 +87,6 @@
         public function getTargetCountry() {
 	
+			if (sizeof($this->arCountry) === 1) return array_values($this->arCountry)[0];
+        	
 			foreach ($this->arCountry as $country_id => $c) {
 		
@@ -96,10 +100,6 @@
         
         public function getTargetCountryID() {
-	
-        	if (sizeof($this->arCountry) === 1) {
-        		
-        		return array_keys($this->arCountry)[0];
-        		
-			}
+        	
+        	if (sizeof($this->arCountry) === 1) return array_keys($this->arCountry)[0];
         	
 			foreach ($this->arCountry as $country_id => $c) {
@@ -452,5 +452,5 @@
          * @param bool $id
          */
-        public function toDB($id = false, $db_data = [], $finish_order) {
+        public function toDB($id = false, $db_data = [], $finish_order = false) {
 	
 			$id = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($id)."' ");
@@ -573,5 +573,14 @@
 			$db_data['shop_country_tax_c'] = wpsg_q($oDefaultCountry->mwst_c);
 			$db_data['shop_country_tax_d'] = wpsg_q($oDefaultCountry->mwst_d);
-	
+				
+			$oTargetCountry = \wpsg_country::getInstance($this->getTargetCountryID());
+			
+			$db_data['target_country_id'] = wpsg_q($oTargetCountry->id);
+			$db_data['target_country_tax'] = wpsg_q($oTargetCountry->mwst);
+			$db_data['target_country_tax_a'] = wpsg_q($oTargetCountry->mwst_a);
+			$db_data['target_country_tax_b'] = wpsg_q($oTargetCountry->mwst_b);
+			$db_data['target_country_tax_c'] = wpsg_q($oTargetCountry->mwst_c);
+			$db_data['target_country_tax_d'] = wpsg_q($oTargetCountry->mwst_d);
+			
 			// Die Hooks verwenden Daten aus $_SESSION, deshalb nur beim Speichern im Frontend
 			if (!is_admin()) {
@@ -663,5 +672,5 @@
 				
             }
-            
+             
             $this->db->Query("DELETE FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `o_id` = '".wpsg_q($id)."' AND `id` NOT IN (".wpsg_q(implode(',', $arOrderProductID)).") ");
             	
@@ -782,5 +791,5 @@
             
 			$this->setTaxMode($db_order['tax_mode']);
-			
+
             $this->addCountry($db_order['shop_country_id'], $db_order['shop_country_tax'], $db_order['shop_country_tax_a'],$db_order['shop_country_tax_b'], $db_order['shop_country_tax_c'], $db_order['shop_country_tax_d'], true);
 			$this->addCountry($db_order['target_country_id'], $db_order['target_country_tax'], $db_order['target_country_tax_a'],$db_order['target_country_tax_b'], $db_order['target_country_tax_c'], $db_order['target_country_tax_d'], false);
@@ -820,7 +829,7 @@
 			$this->addCountry($oDefaultCountry->id, $oDefaultCountry->mwst, $oDefaultCountry->mwst_a, $oDefaultCountry->mwst_b, $oDefaultCountry->mwst_c, $oDefaultCountry->mwst_d,true);
 			
-			if ($ses['land'] != $oDefaultCountry->id) {
-				
-				$oInvoiceCountry = \wpsg_country::getInstance($ses['land']);
+			if ($ses['checkout']['land'] != $oDefaultCountry->id) {
+				
+				$oInvoiceCountry = \wpsg_country::getInstance($ses['checkout']['land']);
 				$this->addCountry($oInvoiceCountry->id, $oInvoiceCountry->mwst, $oInvoiceCountry->mwst_a, $oInvoiceCountry->mwst_b, $oInvoiceCountry->mwst_c, $oInvoiceCountry->mwst_d,false);
 				
@@ -831,6 +840,6 @@
 				foreach ($ses['basket'] as $product_index => $p) {
 					 
-					$oProduct = \wpsg_product::getInstance($this->shop->getProduktID($p['id']));
-					 					
+					$oProduct = \wpsg_product::getInstance($p['id']);
+										
 					$this->addProduct(
 						$oProduct->getPrice($this->shop->getBackendTaxview()), 
@@ -841,5 +850,5 @@
 						$product_index, 
 						false, 
-						$oProduct->leistungsortregel,
+						$oProduct->euleistungsortregel,
 						$p
 					);
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 7241)
+++ /model/wpsg_product.class.php	(revision 7242)
@@ -12,5 +12,5 @@
 		const MULTIPLE_MULTI_ONE = 2; // Mehrfach mit Menge 1
 
-		private $loadedData = array(); /* EnthÃ€lt die Daten, die ÃŒber den ShopController und die Module geladen / erweitert wurden */
+		public $loadedData = array(); /* EnthÃ€lt die Daten, die ÃŒber den ShopController und die Module geladen / erweitert wurden */
 
 		public $product_key = "";		
@@ -88,4 +88,6 @@
 
 			$this->product_key = $product_key;
+			
+			$this->shop->callMods('product_setProductKey', [&$this, $product_key]);
 
 		} // public function setProductKey($product_key)
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 7241)
+++ /mods/wpsg_mod_basic.class.php	(revision 7242)
@@ -981,4 +981,7 @@
 		public function canDisplay($product_key) { }
 		
+		/** wird von wpsg_product aufgerufen, wenn der Produktkey ergÃ€nzt wird */
+		public function product_setProductKey(&$oProduct, $product_key) { }
+		
 		/**
 		 *  Hilfsfunktion, die die Zahlungskosten auf den Warenkorb Array draufschlÃ€gt
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 7241)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 7242)
@@ -293,5 +293,54 @@
 
 		} // public function template_redirect()
-
+		
+		/**
+		 * @param wpsg_product $oProduct
+		 * @param string $product_key
+		 */
+		public function product_setProductKey(&$oProduct, $product_key) { 
+			
+			if ($this->isVariantsProductKey($product_key)) {
+				 
+				$price = $oProduct->price;
+				
+				foreach ($this->getVariantenInfoArray($product_key) as $k => $v) {
+					
+					if (is_numeric($k)) {
+						
+						$price += $v['preis'];
+												
+					}
+					
+				}
+			
+				if ($this->shop->getBackendTaxview() === WPSG_BRUTTO) {
+					
+					$oProduct->loadedData['preis_brutto'] = $price;
+					$oProduct->loadedData['preis_netto'] = wpsg_calculatePreis($price, WPSG_NETTO, $oProduct->getDefaultTaxValue());
+					
+				} else {
+					
+					$oProduct->loadedData['preis_netto'] = $price;
+					$oProduct->loadedData['preis_brutto'] = wpsg_calculatePreis($price, WPSG_BRUTTO, $oProduct->getDefaultTaxValue());
+					
+				}
+				
+				if ($this->shop->getFrontendTaxView() === WPSG_BRUTTO) {
+					
+					$oProduct->loadedData['preis'] = $oProduct->loadedData['preis_brutto'];
+					
+				}
+				else
+				{
+					
+					$oProduct->loadedData['preis'] = $oProduct->loadedData['preis_netto'];
+					
+				}
+				
+				
+			}
+			
+		}
+		
 		public function loadProduktArray(&$product_data)
 		{
