Index: /changelog
===================================================================
--- /changelog	(revision 7636)
+++ /changelog	(revision 7638)
@@ -318,2 +318,4 @@
 - Bugfix: Zusammengefasste/gelÃ¶schte Kunden verschwinden aus der Bestellverwaltung
 - Bugfix: Bricht man die PayPal Zahlung bei PayPal (PayPal Plus) ab und hat die Zahlung ÃŒber den Warenkorb gestartet, wird man in den Warenkorb zurÃŒckgeleitet
+- Bugfix: Zahlungsart fÃ€llt durch LÃ€nderauswahl im Checkout weg, ist aber Kundenvoreinstellung. -> Overview ist korrekt beim ersten laden
+- Technisch: Ausgabe Overview wird zwischengespeichert, um Performance zu erhÃ¶hen
Index: /controller/wpsg_BasketController.class.php
===================================================================
--- /controller/wpsg_BasketController.class.php	(revision 7636)
+++ /controller/wpsg_BasketController.class.php	(revision 7638)
@@ -1,16 +1,17 @@
 <?php
-
+	
 	/**
 	 * Dieser Controller ÃŒbernimmt die Aktionen des Warenkorbs
 	 */
-	class wpsg_BasketController extends wpsg_SystemController
-	{
-				
+	class wpsg_BasketController extends wpsg_SystemController {
+		
+		private static $_outputCache = [];
+		
 		public function content_filter(&$content)
 		{
-
-            if (wpsg_get_the_id() ==  $this->shop->getPagePID(wpsg_ShopController::PAGE_BASKET))
-			{
-
+			
+			if (wpsg_get_the_id() ==  $this->shop->getPagePID(wpsg_ShopController::PAGE_BASKET))
+			{
+				
 				parent::dispatch();
 				
@@ -41,10 +42,10 @@
 				else
 				{
-				
+					
 					$this->basketAction($content);
 					
 				}
 				
-			}			
+			}
 			
 		} // public function content_filter($content)
@@ -74,5 +75,5 @@
 			$this->shop->checkShippingAvailable();
 			$this->shop->checkPaymentAvailable();
-
+			
 			// Sollte es nur eine Versand/Zahlungsart geben, dann diese verwenden
 			
@@ -80,5 +81,5 @@
 			if (sizeof($this->shop->arShipping) == 1) $_SESSION['wpsg']['checkout']['shipping'] = $array_keys_shipping[0];
 			
-			$array_keys_payment = array_keys($this->shop->arPayment); 
+			$array_keys_payment = array_keys($this->shop->arPayment);
 			if (sizeof($this->shop->arPayment) == 1) $_SESSION['wpsg']['checkout']['payment'] = $array_keys_payment[0];
 			
@@ -90,5 +91,5 @@
 				
 			}
-			 
+			
 			// Zur Sicherheit ÃŒberprÃŒfe ich hier noch einmal die Zahlungsarten
 			// Es kann vorkommen, das eine Zahlungsart voreingestellt ist die nicht mehr verfÃŒgbar ist
@@ -103,14 +104,14 @@
 				
 			}
-			 			
+			
 			$this->shop->view['arLander'] = $this->db->fetchAssocField("SELECT L.`id`, L.`name` FROM `".WPSG_TBL_LAND."` AS L ORDER BY L.`name` ", "id", "name");
-
+			
 			// colspan fÃŒr die Zusammenfassung berechnen je nach Option
-			$this->shop->view['colspan'] = 3;			
+			$this->shop->view['colspan'] = 3;
 			if ($this->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
 			
 			if ($this->shop->hasMod('wpsg_mod_onepagecheckout') && ($this->get_option('wpsg_mod_onepagecheckout_basket') == 1))
 			{
-			    
+				
 				$this->shop->view['arShipping'] = $this->shop->arShipping;
 				$this->shop->view['arPayment'] = $this->shop->arPayment;
@@ -121,7 +122,7 @@
 				
 			}
-			else 
-			{
-			    
+			else
+			{
+				
 				$content = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/basket.phtml', false);
 				
@@ -136,18 +137,18 @@
 			if (wpsg_isSizedInt($_REQUEST['set_land']))
 			{
-					
+				
 				if ($this->shop->hasMod('wpsg_mod_shippingadress') && wpsg_isSizedInt($_SESSION['wpsg']['checkout']['shipping_land']))
 				{
-			
+					
 					$_SESSION['wpsg']['checkout']['shipping_land'] = $_REQUEST['set_land'];
-			
+					
 				}
 				else
 				{
-			
+					
 					$_SESSION['wpsg']['checkout']['land'] = $_REQUEST['set_land'];
-			
-				}
-					
+					
+				}
+				
 				// FÃŒr die Abfrage von EU Leistungsort Produkten eintragen
 				if (wpsg_isSizedInt($_SESSION['wpsg']['customerCountry'])) $_SESSION['wpsg']['customerCountry'] = $_REQUEST['set_land'];
@@ -158,7 +159,7 @@
 			if (wpsg_isSizedString($_REQUEST['set_shipping']))
 			{
-					
+				
 				$_SESSION['wpsg']['checkout']['shipping'] = $_REQUEST['set_shipping'];
-					
+				
 			}
 			
@@ -166,7 +167,7 @@
 			if (wpsg_isSizedString($_REQUEST['set_payment']))
 			{
-					
+				
 				$_SESSION['wpsg']['checkout']['payment'] = $_REQUEST['set_payment'];
-					
+				
 			}
 			
@@ -184,5 +185,5 @@
 			
 			$this->shop->basket->initFromSession();
- 
+			
 			$bError = true;
 			$this->shop->callMods('checkBasket', array(&$bError));
@@ -201,14 +202,14 @@
 			if (!wpsg_isSizedArray($arProductIDs))
 			{
-			
+				
 				$this->shop->addFrontendError(__('Es befinden sich keine Produkte im Warenkorb.', 'wpsg'));
 				$this->basketAction($content);
 				return;
-			
+				
 			}
 			
 			// Sollte die Session noch nicht mit Werten gefÃŒllt sein dann hier die Kundenvoreinstellungen laden
 			$this->shop->checkCustomerPreset();
-				
+			
 			if ($this->shop->hasMod('wpsg_mod_onepagecheckout'))
 			{
@@ -222,7 +223,7 @@
 				}
 			}
-				
+			
 			$this->shop->view['pflicht'] = $this->shop->loadPflichtFeldDaten();
-						
+			
 			$this->shop->view['error'] = array();
 			if (wpsg_isSizedArray($_SESSION['wpsg']['errorFields'])) $this->shop->view['error'] = $_SESSION['wpsg']['errorFields'];
@@ -231,10 +232,10 @@
 			$this->shop->view['basket']['checkout']['geb'] = wpsg_fromDate($this->shop->view['basket']['checkout']['geb'], true);
 			
-			$this->shop->view['laender'] = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_LAND."` ORDER BY `name` ASC");			
+			$this->shop->view['laender'] = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_LAND."` ORDER BY `name` ASC");
 			
 			$this->shop->view['arAnrede']= explode('|', $this->shop->get_option('wpsg_admin_pflicht')['anrede_auswahl']);
 			
 			$content = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/checkout.phtml', false);
-						
+			
 		} // public function checkoutAction()
 		
@@ -251,30 +252,30 @@
 			if (!wpsg_isSizedArray($temp))
 			{
-					
+				
 				$this->shop->addFrontendError(__('Es befinden sich keine Produkte im Warenkorb.', 'wpsg'));
 				$this->basketAction($content);
 				return;
-					
+				
 			}
 			
 			$this->shop->view['error'] = $_SESSION['wpsg']['errorFields'];
 			$this->shop->view['basket'] = $this->shop->basket->toArray();
-			 
+			
 			// Alte Werte lÃ¶schen / Warum war das mal drin ? 			
 			//unset($_SESSION['wpsg']['checkout']['shipping']);
 			//unset($_SESSION['wpsg']['checkout']['payment']);
-			 
+			
 			$this->shop->checkShippingAvailable();
 			$this->shop->checkPaymentAvailable();
-
-            if (sizeof($this->shop->arShipping) > 0 && (!in_array($_SESSION['wpsg']['checkout']['shipping'], array_keys($this->shop->arShipping)) || !in_array($_SESSION['wpsg']['checkout']['payment'], array_keys($this->shop->arPayment)))) {
-
-                if (!in_array($_SESSION['wpsg']['checkout']['shipping'], array_keys($this->shop->arShipping))) $_SESSION['wpsg']['checkout']['shipping'] = array_keys($this->shop->arShipping)[0];
-                if (!in_array($_SESSION['wpsg']['checkout']['payment'], array_keys($this->shop->arPayment))) $_SESSION['wpsg']['checkout']['payment'] = array_keys($this->shop->arPayment)[0];
-
-                $this->shop->basket->initFromSession(true);
-                $this->shop->view['basket'] = $this->shop->basket->toArray();
-
-            }
+			
+			if (sizeof($this->shop->arShipping) > 0 && (!in_array($_SESSION['wpsg']['checkout']['shipping'], array_keys($this->shop->arShipping)) || !in_array($_SESSION['wpsg']['checkout']['payment'], array_keys($this->shop->arPayment)))) {
+				
+				if (!in_array($_SESSION['wpsg']['checkout']['shipping'], array_keys($this->shop->arShipping))) $_SESSION['wpsg']['checkout']['shipping'] = array_keys($this->shop->arShipping)[0];
+				if (!in_array($_SESSION['wpsg']['checkout']['payment'], array_keys($this->shop->arPayment))) $_SESSION['wpsg']['checkout']['payment'] = array_keys($this->shop->arPayment)[0];
+				
+				$this->shop->basket->initFromSession(true);
+				$this->shop->view['basket'] = $this->shop->basket->toArray();
+				
+			}
 			
 			$this->shop->view['arShipping'] = $this->shop->arShipping;
@@ -288,57 +289,67 @@
 		 * Funktion fÃŒr die Bestellzusammenfassung
 		 */
-		private function overviewAction(&$content)
-		{
-
-			$this->shop->basket->initFromSession();
-			
-			// Wenn keine Produkte drin sind, dann mit Fehlermeldung zum Warenkorb leiten
-			$temp = $this->shop->basket->getProductIDs();
-			if (!wpsg_isSizedArray($temp)) 
-			{
-
-				$this->shop->addFrontendError(__('Es befinden sich keine Produkte im Warenkorb.', 'wpsg'));
-				$this->basketAction($content);
-				return;
-								
-			}
-			
-			// Wenn die Overview PrÃŒfung nicht bestanden wurde, dann zum Checkout leiten
-			if (!$this->shop->basket->checkCheckout(3))
-			{
-				
-				if ($this->shop->hasMod('wpsg_mod_onepagecheckout') && ($this->shop->get_option('wpsg_mod_onepagecheckout_basket') == 1))
-				{
+		private function overviewAction(&$content) {
+			
+			if (!isset($this->_outputCache['overview'])) {
+				
+				$this->shop->basket->initFromSession();
+				
+				// Wenn keine Produkte drin sind, dann mit Fehlermeldung zum Warenkorb leiten
+				$temp = $this->shop->basket->getProductIDs();
+				if (!wpsg_isSizedArray($temp))
+				{
+					
+					$this->shop->addFrontendError(__('Es befinden sich keine Produkte im Warenkorb.', 'wpsg'));
 					$this->basketAction($content);
 					return;
-				}
-				else
-				{
-					$this->checkoutAction($content);
-					return;
-				}
-				
-			}
-			
-			$this->shop->view['pflicht'] = $this->shop->loadPflichtFeldDaten();
-			
-			$this->shop->view['error'] = $_SESSION['wpsg']['errorFields'];
-			
-			$this->shop->view['basket'] = $this->shop->basket->toArray();
+					
+				}
+				
+				// Wenn die Overview PrÃŒfung nicht bestanden wurde, dann zum Checkout leiten
+				if (!$this->shop->basket->checkCheckout(3))
+				{
+					
+					if ($this->shop->hasMod('wpsg_mod_onepagecheckout') && ($this->shop->get_option('wpsg_mod_onepagecheckout_basket') == 1))
+					{
+						$this->basketAction($content);
+						return;
+					}
+					else
+					{
+						$this->checkoutAction($content);
+						return;
+					}
+					
+				}
+				
+				$this->shop->view['pflicht'] = $this->shop->loadPflichtFeldDaten();				
+				$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']])) {
+					
+					$this->shop->basket->initFromSession(true);
+					$this->shop->view['basket'] = $this->shop->basket->toArray();
+					
+				}
 
-			$this->shop->checkShippingAvailable();
-			$this->shop->checkPaymentAvailable();
-						
-			$this->shop->view['arShipping'] = $this->shop->arShipping;
-			$this->shop->view['arPayment'] = $this->shop->arPayment;
-			
-			// colspan fÃŒr die Zusammenfassung berechnen je nach Option
-			$this->shop->view['colspan'] = 2;
-			if ($this->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
-			$content = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/overview.phtml', false);
+            	$this->shop->view['arShipping'] = $this->shop->arShipping;
+            	$this->shop->view['arPayment'] = $this->shop->arPayment;
+            
+				// colspan fÃŒr die Zusammenfassung berechnen je nach Option
+				$this->shop->view['colspan'] = 2;
+				if ($this->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
+				
+				$this->_outputCache['overview'] = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/overview.phtml', false);
+	
+			 }
+			
+			$content = $this->_outputCache['overview'];
 			
 		} // private function overviewAction()
-				
+		
 		/**
 		 * Seite, die nach der Bestellung angezeigt wird
@@ -355,5 +366,5 @@
 			$hash = preg_replace('/(\+)|(\=)/', 'A', base64_encode(md5('wpShopGermany'.$order_id, $this->get_option("wpsg_salt"))));
 			
-			if ($hash != $_REQUEST['wpsg_done']) 
+			if ($hash != $_REQUEST['wpsg_done'])
 			{
 				die(__('Aufrufsfehler!!', 'wpsg'));
@@ -367,5 +378,5 @@
 			
 			$content = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/done.phtml', false);
-						
+			
 		} // private function doneAction()
 		
@@ -387,8 +398,8 @@
 			}
 			
-			 
+			
 			if (isset($_REQUEST['wpsg_form_data']))
 			{
-								
+				
 				parse_str($_REQUEST['wpsg_form_data'], $request);
 				$_REQUEST = array_merge_recursive($_REQUEST, $request);
@@ -398,10 +409,10 @@
 			if (isset($_REQUEST['wpsg']['action']) && $_REQUEST['wpsg']['action'] == 'customeranswer')
 			{
-
+				
 				// Der Preisdialog wurde beantwortet
 				$_SESSION['wpsg']['priceDialog'] = true;
 				$_SESSION['wpsg']['customertype'] = $_REQUEST['wpsg']['customertype'];
 				$_SESSION['wpsg']['checkout']['land'] = $_REQUEST['wpsg']['customerCountry'];
-				 				
+				
 				$this->redirect($_REQUEST['wpsg']['redirect']);
 				
@@ -411,5 +422,5 @@
 				
 				// Checkout Aktualisierung ÃŒber AJAX				
-				if (isset($_REQUEST['wpsg']['checkout']['shipping'])) $_SESSION['wpsg']['checkout']['shipping'] = $_REQUEST['wpsg']['checkout']['shipping']; 
+				if (isset($_REQUEST['wpsg']['checkout']['shipping'])) $_SESSION['wpsg']['checkout']['shipping'] = $_REQUEST['wpsg']['checkout']['shipping'];
 				if (isset($_REQUEST['wpsg']['checkout']['payment'])) $_SESSION['wpsg']['checkout']['payment'] = $_REQUEST['wpsg']['checkout']['payment'];
 				
@@ -418,5 +429,5 @@
 			}
 			else if (wpsg_isSizedString($_REQUEST['wpsg']['action'], 'widget'))
-			{ 
+			{
 				
 				the_widget('wpsg_basket_widget');
@@ -432,5 +443,5 @@
 				if ($this->shop->callMods('basket_checkoutAction', array(&$this)) == false)
 				{
-			 	 
+					
 					$this->redirect($this->shop->getURL(wpsg_ShopController::URL_BASKET));
 					
@@ -438,9 +449,9 @@
 				
 			}
-
+			
 			// Warenkorb wurde verarbeitet, soll ein Modul die Umleitung ÃŒbernehmen?
 			if (wpsg_isSizedString($_REQUEST['wpsg_mod_submit']))
 			{
-				 
+				
 				$this->shop->callMod($_REQUEST['wpsg_mod_submit'], 'basket_submitSuccess');
 				
@@ -453,9 +464,9 @@
 				parent::dispatch();
 				
-				$this->shop->view['defaultCountry_id'] = $this->shop->getFrontendCountry(true);				
+				$this->shop->view['defaultCountry_id'] = $this->shop->getFrontendCountry(true);
 				$this->shop->view['url'] = $_REQUEST['wpsg']['url'];
 				
 				$geo_code = wpsg_geo_code();
-				$country_id = $this->db->fetchOne("SELECT L.`id` FROM `".WPSG_TBL_LAND."` AS L WHERE L.`kuerzel` = '".wpsg_q($geo_code)."' ");				
+				$country_id = $this->db->fetchOne("SELECT L.`id` FROM `".WPSG_TBL_LAND."` AS L WHERE L.`kuerzel` = '".wpsg_q($geo_code)."' ");
 				if (wpsg_isSizedInt($country_id)) $this->shop->view['defaultCountry_id'] = $country_id;
 				
@@ -464,16 +475,16 @@
 				die($this->shop->render(WPSG_PATH_VIEW.'/warenkorb/customerquestion.phtml'));
 				
-			}			
+			}
 			else if (isset($_REQUEST['wpsg']['submit']) && intval($_REQUEST['wpsg']['menge']) > 0 && intval($_REQUEST['wpsg']['produkt_id']) > 0)
 			{
-
+				
 				// Ein Produktformular wurde abgeschickt
 				// http://wp.home/wpsg4/warenkorb/?wpsg[produkt_id]=6&wpsg[submit]=1&wpsg[menge]=1
 				// https://shop.maennchen1.de/warenkorb/?wpsg[produkt_id]=63&wpsg[submit]=1&wpsg[menge]=1&wpsg_vp[5]=10
-
+				
 				parent::dispatch();
-				  		
+				
 				$this->shop->callMods('basket_preInsert');
- 
+				
 				$product_key = $_REQUEST['wpsg']['produkt_id'];
 				$this->shop->callMods('getProductKeyFromRequest', array(&$product_key, $_REQUEST['wpsg']['produkt_id'], $_REQUEST));
@@ -481,5 +492,5 @@
 				// Produkt hinzufÃŒgen
 				$bOK = $this->shop->basket->addProduktToSession($product_key, $_REQUEST['wpsg']['menge']);
-					
+				
 				if ($this->shop->get_option('wpsg_afterinsert') == '2') die();
 				
@@ -488,5 +499,5 @@
 					
 					$this->shop->basket->initFromSession(true);
-					 
+					
 					$this->shop->view['product_data'] = $this->shop->loadProduktArray($this->shop->getProduktId($product_key));
 					$this->shop->view['oProduct'] = wpsg_product::getInstance($this->shop->getProduktID($product_key));
@@ -494,32 +505,32 @@
 					$this->shop->view['amount_add'] = $_REQUEST['wpsg']['menge'];
 					$this->shop->view['amount_basket'] = $this->shop->basket->getBasketAmount($_REQUEST['wpsg']['produkt_id']);
-					$this->shop->view['product_index'] = $GLOBALS['wpsg_lastInsertIndex'];	
-
-				}
-				 
-				if ($this->shop->get_option('wpsg_afterinsert') == '4') 
-				{
-						
+					$this->shop->view['product_index'] = $GLOBALS['wpsg_lastInsertIndex'];
+					
+				}
+				
+				if ($this->shop->get_option('wpsg_afterinsert') == '4')
+				{
+					
 					$this->redirect($_REQUEST['myReferer']);
-
-				}
-
+					
+				}
+				
 				// Erfolgsmeldung hinzufÃŒgen
 				if ($bOK === true) $this->shop->addFrontendMessage(__('Produkt erfolgreich in den Warenkorb gelegt.', 'wpsg'));
-				else if ($bOK === -1) 
-				{ 
-
+				else if ($bOK === -1)
+				{
+					
 					// Hier Warenkorb ohne Meldung anzeigen / FÃŒr den Fall, dass das Produkt nur einmal im Warenkorb auftauchen darf
 					
 				}
-				else 
-				{
-				 
+				else
+				{
+					
 					if ($this->shop->get_option('wpsg_afterinsert') == '3')
 					{
 						
 						die($this->shop->render(WPSG_PATH_VIEW.'warenkorb/messageDialog.phtml'));
-											
-					}					
+						
+					}
 					
 					// Fehler beim hinzufÃŒgen, hier einfach auf der Seite bleiben					
@@ -535,7 +546,7 @@
 						
 						$this->shop->view['product_data']['preis'] = $this->shop->view['oProduct']->getPrice($product_key, $this->shop->getFrontendTaxview());
-												
+						
 						$this->shop->view['content'] = $this->shop->render(WPSG_PATH_VIEW.'warenkorb/ajaxDialog.phtml', false);
-												
+						
 						die($this->shop->render(WPSG_PATH_VIEW.'warenkorb/messageDialog.phtml'));
 						
@@ -543,5 +554,5 @@
 					else
 					{
-					 						
+						
 						die("1");
 						
@@ -561,5 +572,5 @@
 					
 				}
-								
+				
 			}
 			else if (isset($_REQUEST['wpsg_basket_ajax']))
@@ -569,5 +580,5 @@
 				
 				$this->basketAction($content);
-								
+				
 				die($content);
 			}
@@ -602,10 +613,10 @@
 					
 					$this->addFrontendError(__('Ein Gutschein mit diesem Code existiert nicht!', 'wpsg'));
-					$_SESSION['wpsg']['errorFields'][] = 'gutschein';					
+					$_SESSION['wpsg']['errorFields'][] = 'gutschein';
 					
 					$this->redirect($this->shop->getURL(wpsg_ShopController::URL_BASKET));
 					
 				}
-				else 
+				else
 				{
 					
@@ -630,9 +641,9 @@
 						
 						if ($gs_db['o_id'] > 0 && $gs_db['multi'] !== '1') {
-																					
+							
 							// Gutschein ist bereits verbraucht
 							$this->addFrontendError(__('Dieser Gutscheincode wurde bereits eingelÃ¶st und ist nicht mehrfach verwendbar.', 'wpsg'));
 							$_SESSION['wpsg']['errorFields'][] = 'gutschein';
-							 
+							
 						}
 						else
@@ -642,8 +653,8 @@
 							
 							if ($this->shop->get_option('wpsg_mod_discount_voucher') === '1') {
-																
+								
 								if ($this->shop->callMod('wpsg_mod_discount', 'hasDiscount', [$arBasket]) === true) $bDiscount = true;
 								else $bDiscount = false;
-								 								
+								
 								if ($bDiscount) {
 									
@@ -656,5 +667,5 @@
 								
 							}
-														 							 
+							
 							if ($bCheckDiscount) {
 								
@@ -666,5 +677,5 @@
 									
 								} else {
-							
+									
 									// Gutschein ist von der grÃ¶Ãe des Warenkorbes begrenzt.
 									if (wpsg_tf($gs_db['minvalue']) > 0 && wpsg_tf($gs_db['minvalue']) > $arBasket['sum']['preis'])
@@ -677,5 +688,5 @@
 									else
 									{
-																		
+										
 										$this->shop->basket->initFromSession();
 										$arProductIDsBasket = $this->shop->basket->getProductIDs();
@@ -716,5 +727,5 @@
 											
 										}
-																	
+										
 										if (wpsg_isSizedArray($wrongProducts))
 										{
@@ -724,10 +735,10 @@
 												
 												$product = $this->shop->loadProduktArray(array_values($wrongProducts)[0]);
-												$this->addFrontendError(wpsg_translate(__('Gutschein konnte nicht hinzugefÃŒgt werden, da er fÃŒr das Produkt #1# nicht zulÃ€ssig ist.', 'wpsg'), $product['name']));		
+												$this->addFrontendError(wpsg_translate(__('Gutschein konnte nicht hinzugefÃŒgt werden, da er fÃŒr das Produkt #1# nicht zulÃ€ssig ist.', 'wpsg'), $product['name']));
 												
 											}
 											else
 											{
-											
+												
 												$arProductNames = array();
 												foreach ($wrongProducts as $product_id)
@@ -742,10 +753,10 @@
 												
 											}
-												
+											
 										}
 										else
 										{
-			
-											$this->addFrontendMessage(__('Gutschein wurde der Bestellung erfolgreich hinzugefÃŒgt.', 'wpsg'));							
+											
+											$this->addFrontendMessage(__('Gutschein wurde der Bestellung erfolgreich hinzugefÃŒgt.', 'wpsg'));
 											$this->shop->basket->addGutscheinToSession($gs_db['value'], $gs_db['calc_typ'], $gs_db['code'], $gs_db['id']);
 											
@@ -757,5 +768,5 @@
 								
 							}
-
+							
 						}
 						
@@ -766,17 +777,17 @@
 				}
 				
-			}			
+			}
 			else if (isset($_REQUEST['wpsg_order']))
 			{
-		 
+				
 				parent::dispatch();
 				
 				// Bestellung abschlieÃen
 				$this->shop->basket->initFromSession();
-
+				
 				$bOK = $this->shop->basket->checkCheckout();
 				
 				if ($bOK)
-				{ 
+				{
 					
 					$bModulError = false; $this->shop->callMods('checkFinaly', array(&$bModulError));
@@ -792,19 +803,19 @@
 						
 						$this->addFrontendError(
-								wpsg_translate(
-										__('Sie mÃŒssen unsere #1# und #2# gelesen haben, um eine Bestellung durchzufÃŒhren! Bitte setzen Sie unten das entsprechende HÃ€kchen!', 'wpsg'),
-										'<a href="'.$this->shop->getURL(wpsg_ShopController::URL_AGB).'">'.__('AGB', 'wpsg').'</a>',
-										'<a href="'.$this->shop->getURL(wpsg_ShopController::URL_WIDERRUF).'">'.__('Widerrufsbelehrung', 'wpsg').'</a>'
-								)
+							wpsg_translate(
+								__('Sie mÃŒssen unsere #1# und #2# gelesen haben, um eine Bestellung durchzufÃŒhren! Bitte setzen Sie unten das entsprechende HÃ€kchen!', 'wpsg'),
+								'<a href="'.$this->shop->getURL(wpsg_ShopController::URL_AGB).'">'.__('AGB', 'wpsg').'</a>',
+								'<a href="'.$this->shop->getURL(wpsg_ShopController::URL_WIDERRUF).'">'.__('Widerrufsbelehrung', 'wpsg').'</a>'
+							)
 						);
 						
 						$this->redirect($this->shop->getURL(wpsg_ShopController::URL_OVERVIEW));
-												
-					}
-					else 
+						
+					}
+					else
 					{
 						
 						$order_id = $this->shop->basket->save();
-												
+						
 						$this->redirect($this->shop->getDoneURL($order_id));
 						
@@ -826,5 +837,5 @@
 				
 				if (preg_match('/^voucher_(\d+)?/', $_REQUEST['wpsg_produkt'], $m)) {
-				
+					
 					foreach ($_SESSION['wpsg']['gs'] as $gs_k => $gs) {
 						
@@ -832,15 +843,15 @@
 						
 					}
-										
+					
 					$this->shop->addFrontendMessage(__('Gutschein erfolgreich entfernt.', 'wpsg'));
-									
+					
 				}
 				else
 				{
-				
+					
 					// Produkt entfernen
 					if ($this->shop->basket->removeProduktFromSession($_REQUEST['wpsg_produkt']))
 					{
-					
+						
 						// Erfolgsmeldung hinzufÃŒgen
 						$this->shop->addFrontendMessage(__('Produkt erfolgreich entfernt.', 'wpsg'));
@@ -849,7 +860,7 @@
 					
 					$this->shop->callMods('basket_afterRemove');
-				
-				}
-					
+					
+				}
+				
 				$this->redirect($this->shop->getURL(wpsg_ShopController::URL_BASKET));
 				
@@ -865,5 +876,5 @@
 				//die(wpsg_debug($_REQUEST['wpsg']['menge']));
 				// Warenkorb aktualisieren
-								
+				
 				foreach ($_REQUEST['wpsg']['menge'] as $product_index => $produkt_menge)
 				{
@@ -896,5 +907,5 @@
 								
 							}
-						 
+							
 							$_REQUEST = $request;
 							
@@ -918,5 +929,5 @@
 							
 							$this->shop->addFrontendError(__('Produkt darf nur einmal im Warenkorb auftauchen.', 'wpsg'));
-														
+							
 						}
 						
@@ -924,12 +935,12 @@
 					else
 					{
-
+						
 						// Nur einmal mit beliebiger Menge
 						if (!$this->shop->basket->updateProduktFromSession($product_index, $produkt_menge)) $bError = true;
 						
 					}
-										
+					
 				} // foreach
-								
+				
 				$this->setBasketData();
 				$this->shop->cache->clearShopBasketArray();
@@ -947,9 +958,9 @@
 				$this->redirect($this->shop->getURL(wpsg_ShopController::URL_BASKET));
 				
-			} 
+			}
 			// Der AusschluÃ von wpsg_mod ist nÃ¶tig, da PayPal PLUS die Versandart Ã€ndert
 			else if (isset($_REQUEST['wpsg']['checkout']) && !isset($_REQUEST['wpsg_mod']))
 			{
-			
+				
 				// Checkout wurde abgeschickt
 				parent::dispatch();
@@ -958,10 +969,10 @@
 				
 				$this->shop->callMods('doCheckout');
-				 
+				
 				$this->shop->basket->initFromSession(true);
 				
 				// Checkout1 muss immer geprÃŒft werden, ist z.B. fÃŒr das Kundenmodul notwendig!				
 				$bOK = $this->shop->basket->checkCheckout(1);
-								
+				
 				if (isset($_REQUEST['wpsg_checkout']))
 				{
@@ -980,5 +991,5 @@
 						$target_error = $this->shop->getURL(wpsg_ShopController::URL_CHECKOUT);
 						$target = $this->shop->getURL(wpsg_ShopController::URL_OVERVIEW);
-						 
+						
 					}
 					else
@@ -1001,9 +1012,9 @@
 						
 					}
-																				
+					
 				}
 				else if (isset($_REQUEST['wpsg_checkout2']))
 				{
-										
+					
 					$bOK = $this->shop->basket->checkCheckout(2);
 					
@@ -1011,8 +1022,8 @@
 					$target = $this->shop->getURL(wpsg_ShopController::URL_OVERVIEW);
 					
-				} 
+				}
 				else
 				{
-					 
+					
 					die(__('Unerwarteter Fehler!', 'wpsg'));
 					
@@ -1043,12 +1054,11 @@
 					
 				}
-					
+				
 				die();
 				
-			} 
+			}
 			
 		} // public function template_redirect()
-				
+		
 	} // class wpsg_BasketController extends wpsg_SystemController
 
-?>
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7636)
+++ /controller/wpsg_ShopController.class.php	(revision 7638)
@@ -16,5 +16,5 @@
 		var $basketController;
 
-		/** Der Warenkorb */
+		/** @var wpsg_basket Der Warenkorb */
 		var $basket;
 
Index: /mods/wpsg_mod_paypalapi.class.php
===================================================================
--- /mods/wpsg_mod_paypalapi.class.php	(revision 7636)
+++ /mods/wpsg_mod_paypalapi.class.php	(revision 7638)
@@ -1342,5 +1342,5 @@
 			else
 			{
-			
+				
 				$post_data['redirect_urls'] = array(
 					'return_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'returnPayPalExpress'),
