Index: /changelog
===================================================================
--- /changelog	(revision 7872)
+++ /changelog	(revision 7873)
@@ -446,2 +446,5 @@
 #4.3.1
 - Bugfix: Korrektur Berechnung Versand- und Zahlungsarten
+
+#4.3.2
+- Bugfix: Korrektur Berechnung Versand- und Zahlungsarten
Index: /controller/wpsg_BasketController.class.php
===================================================================
--- /controller/wpsg_BasketController.class.php	(revision 7872)
+++ /controller/wpsg_BasketController.class.php	(revision 7873)
@@ -60,4 +60,18 @@
             $this->shop->checkPaymentAvailable();
 
+            $array_keys_shipping = array_keys($this->shop->arShipping);
+			if (sizeof($this->shop->arShipping) === 1 || !in_array($_SESSION['wpsg']['checkout']['shipping'], $array_keys_shipping)) {
+
+			    $_SESSION['wpsg']['checkout']['shipping'] = $array_keys_shipping[0];
+
+            }
+
+			$array_keys_payment = array_keys($this->shop->arPayment);
+			if (sizeof($this->shop->arPayment) === 1 || !in_array($_SESSION['wpsg']['checkout']['payment'], $array_keys_payment)) {
+
+			    $_SESSION['wpsg']['checkout']['payment'] = $array_keys_payment[0];
+
+            }
+
 			// Basket aus Session zusammenbauen
 			$this->shop->basket->initFromSession();
@@ -75,21 +89,4 @@
 			
 			// Sollte es nur eine Versand/Zahlungsart geben, dann diese verwenden
-			
-			$array_keys_shipping = array_keys($this->shop->arShipping);
-			if (sizeof($this->shop->arShipping) === 1 || !in_array($_SESSION['wpsg']['checkout']['shipping'], $array_keys_shipping)) {
-
-			    $_SESSION['wpsg']['checkout']['shipping'] = $array_keys_shipping[0];
-                $this->shop->view['basket']['checkout']['shipping'] = $array_keys_shipping[0];
-
-            }
-			
-			$array_keys_payment = array_keys($this->shop->arPayment);
-			if (sizeof($this->shop->arPayment) === 1 || !in_array($_SESSION['wpsg']['checkout']['payment'], $array_keys_payment)) {
-
-			    $_SESSION['wpsg']['checkout']['payment'] = $array_keys_payment[0];
-                $this->shop->view['basket']['checkout']['payment'] = $array_keys_payment[0];
-
-            }
-
 			if (sizeof($this->shop->arShipping) == 1 || sizeof($this->shop->arPayment) == 1) {
 				
@@ -298,5 +295,5 @@
 				// Wenn keine Produkte drin sind, dann mit Fehlermeldung zum Warenkorb leiten
 				$temp = $this->shop->basket->getProductIDs();
-				
+
 				if (!wpsg_checkInput($temp, WPSG_SANITIZE_ARRAY_INT)) {
 					
@@ -307,5 +304,5 @@
 					
 				}
-				
+
 				// Wenn die Overview PrÃŒfung nicht bestanden wurde, dann zum Checkout leiten
 				if (!$this->shop->basket->checkCheckout(3)) {
@@ -331,10 +328,10 @@
 				$this->shop->view['error'] = array();
 				if (wpsg_checkInput($_SESSION['wpsg']['errorFields'], WPSG_SANITIZE_ARRAY_TEXTFIELD)) $this->shop->view['error'] = $_SESSION['wpsg']['errorFields'];			
-				
+
 				$this->shop->view['basket'] = $this->shop->basket->toArray();
 				
 				$this->shop->checkShippingAvailable();
 				$this->shop->checkPaymentAvailable();
-				 				
+
 				if (!isset($this->shop->arShipping[$this->shop->view['basket']['checkout']['shipping']]) || !isset($this->shop->arShipping[$this->shop->view['basket']['checkout']['payment']])) {
 					
@@ -350,5 +347,5 @@
 				$this->shop->view['colspan'] = 2;
 				if ($this->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-				
+
 				self::$_outputCache['overview'] = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/overview.phtml', false);
 	
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7872)
+++ /controller/wpsg_ShopController.class.php	(revision 7873)
@@ -3319,7 +3319,6 @@
 			if (!is_admin()) {
 
-
-			    $this->basket->initFromSession();
-			    $this->addShipPay();
+				$this->addShipPay();
+				$this->basket->initFromSession();
 
 			}
Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 7872)
+++ /lib/wpsg_basket.class.php	(revision 7873)
@@ -40,4 +40,5 @@
 		public $arCheckout;
 
+		/** @var \wpsg\wpsg_calculation */
 		public $oCalculation = null;
 		
@@ -1531,6 +1532,5 @@
 			// Dies darf im checkout2 nicht passieren, oder wenn der Parameter auf true
 			//			if (false && $this->o_id > 0)
-			if ($this->o_id > 0)
-			{
+			if ($this->o_id > 0) {
 				
 				$order_data = $this->shop->cache->loadOrder($this->o_id);
@@ -1565,7 +1565,6 @@
 				}
 				*/
-			}
-			else
-			{
+
+			} else {
 				
 				// Bin mir nicht sicher warum die Versandkosten/Zahlungskosten im Checkout nicht berechnet wurde
@@ -1718,5 +1717,5 @@
 			}
 
-			if ($this->oCalculation === null) {
+			if (true || $this->oCalculation === null) {
 
 				$this->oCalculation = new \wpsg\wpsg_calculation();
Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 7872)
+++ /lib/wpsg_calculation.class.php	(revision 7873)
@@ -1222,5 +1222,5 @@
         
 		public function fromSession() {
-		 
+
 			$ses = (isset($_SESSION['wpsg'])?$_SESSION['wpsg']:[]);
 			 
@@ -1260,5 +1260,5 @@
 			
 			$this->shop->callMods('calculation_fromSession',[&$this, true, false]);
-			
+
 			// Payment
 			if (isset($_SESSION['wpsg']['checkout']['payment']) && array_key_exists($_SESSION['wpsg']['checkout']['payment'], $this->shop->arPayment)) {
@@ -1268,5 +1268,5 @@
 
                 if (wpsg_isSizedArray($payment)) {
-                 
+
                     $this->addPayment($price, $this->shop->getBackendTaxview(), @$payment['tax_key'], $_SESSION['wpsg']['checkout']['payment']);
                     
Index: /lib/wpsg_db.class.php
===================================================================
--- /lib/wpsg_db.class.php	(revision 7872)
+++ /lib/wpsg_db.class.php	(revision 7873)
@@ -29,14 +29,12 @@
 			global $wpdb;
 
-			if ($wpdb->query($strQuery) === false) {
-				
-				$this->handleError();
-				
-			}
-			else
-			{
-			
-				$result = $wpdb->get_var($strQuery);
- 
+			$result = $wpdb->get_var($strQuery);
+
+			if ($result === false) {
+				
+				$this->handleError();
+				
+			} else {
+
 				return $result;
 				
@@ -48,20 +46,16 @@
 		 * Gibt eine ganze Zeile als Ergebnis aus der Datenbank zurÃŒck
 		 */
-		function fetchRow($strQuery)
-		{
-			
-			global $wpdb;
-			 
-			if ($wpdb->query($strQuery) === false)
-			{
-			
-				$this->handleError();
-			
-			}
-			else
-			{
-					
-				$result = $wpdb->get_row($strQuery, ARRAY_A);
-			 
+		function fetchRow($strQuery) {
+			
+			global $wpdb;
+
+			$result = $wpdb->get_row($strQuery, ARRAY_A);
+
+			if ($result === false) {
+			
+				$this->handleError();
+			
+			} else {
+
 				return $result;
 			
@@ -74,27 +68,21 @@
 		 * Ist der Parameter $key ungleich zu false, so ist der SchlÃŒssel des Arrays die in $key ÃŒbergebene Spalte 
 		 */
-		function fetchAssoc($strQuery, $key = false)
-		{
-			
-			global $wpdb;
-			
-			if ($wpdb->query($strQuery) === false)
-			{
-					
-				$this->handleError();
-					
-			}
-			else
-			{
-			
-				$arReturn1 = $wpdb->get_results($strQuery, ARRAY_A);
-				
-				if ($key != false)
-				{
+		function fetchAssoc($strQuery, $key = false) {
+			
+			global $wpdb;
+
+			$arReturn1 = $wpdb->get_results($strQuery, ARRAY_A);
+
+			if ($arReturn1 === false) {
+					
+				$this->handleError();
+					
+			} else {
+
+				if ($key != false) {
 					
 					$arReturn = array();
 					
-					foreach ($arReturn1 as $k => $v)
-					{
+					foreach ($arReturn1 as $k => $v) {
 						
 						$arReturn[$v[$key]] = $v;
@@ -104,7 +92,5 @@
 					return $arReturn;
 					
-				}
-				else
-				{
+				} else {
 					
 					return $arReturn1;
@@ -121,23 +107,19 @@
 		 * Der Parameter strValueField ist die Spalte fÃŒr den Wert des Arrays 
 		 */
-		function fetchAssocField($strQuery, $strKeyField = false, $strValueField = false)
-		{
-		
-			global $wpdb;
-			
-			if ($wpdb->query($strQuery) === false)
-			{
-					
-				$this->handleError();
-					
-			}
-			else
-			{
-			
-				$db_rows = $wpdb->get_results($strQuery, ARRAY_A);
+		function fetchAssocField($strQuery, $strKeyField = false, $strValueField = false) {
+		
+			global $wpdb;
+
+			$db_rows = $wpdb->get_results($strQuery, ARRAY_A);
+
+			if ($db_rows === false) {
+					
+				$this->handleError();
+					
+			} else {
+
 				$arReturn = array();			
 				
-				foreach ($db_rows as $row)
-				{
+				foreach ($db_rows as $row) {
 					 
 					if ($strKeyField != false && $strValueField != false)
@@ -315,3 +297,3 @@
  		} // function unlockTables()
 		
-	} // class wpsg_db
+	}
Index: /views/warenkorb/overview.phtml
===================================================================
--- /views/warenkorb/overview.phtml	(revision 7872)
+++ /views/warenkorb/overview.phtml	(revision 7873)
@@ -6,6 +6,4 @@
 	 */
 
-	//wpsg_debug($this->view['basket']);
-	
 	if ($this->getFrontendTaxView() === WPSG_BRUTTO) $display_brutto_netto = 'brutto';
 	else $display_brutto_netto = 'netto';
