Index: /controller/wpsg_AdminController.class.php
===================================================================
--- /controller/wpsg_AdminController.class.php	(revision 6337)
+++ /controller/wpsg_AdminController.class.php	(revision 6338)
@@ -2,9 +2,9 @@
 
 	/**
-	 * AdminController fÃŒr Backend 
+	 * AdminController fÃŒr Backend
 	 */
-	class wpsg_AdminController extends wpsg_SystemController 
+	class wpsg_AdminController extends wpsg_SystemController
 	{
-		
+
 		/**
 		 * Ãbernimmt das Routing
@@ -12,63 +12,63 @@
 		public function dispatch()
 		{
-			
+
 			parent::dispatch();
-						
+
 			if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'module')
 			{
-				
+
 				$this->moduleAction();
-				
+
 			}
 			else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'hilfe')
 			{
-				
+
 				$this->hilfeAction();
-				
+
 			}
 			else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'migratemwst')
 			{
-				
+
 				$this->migratemwstAction();
-				
+
 			}
 			else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ueber')
 			{
-				
+
 				$this->ueberAction();
-				
+
 			}
 			else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'news')
 			{
-				
+
 				$this->newsAction();
-				
+
 			}
 			else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'registrierung')
 			{
-				
+
 				if (!current_user_can('wpsg_lizence')) die(__('Kein Zugriff', 'wpsg'));
-				
+
 				$this->registrierungAction();
-				
-			}	 
+
+			}
 			else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'clearMessage')
 			{
-				
+
 				$this->shop->hidePersistentBackendError($_REQUEST['wpsg_message']);
-				
+
 				$this->shop->clearMessages();
 				$this->shop->redirect(rawurldecode($_REQUEST['wpsg_redirect']));
-				
-			}			
+
+			}
 			else
 			{
-							
+
 				$this->indexAction();
-				
-			}
-			
+
+			}
+
 		} // public function dispatch()
-		
+
 		/**
 		 * Index des Backends
@@ -76,15 +76,15 @@
 		public function indexAction()
 		{
-			
+
 			$this->shop->view = array(
 				'actionName' => 'index',
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/konfiguration.phtml'
 			);
-			
+
 			$this->shop->view['arSubAction'] = array();
 			$this->shop->view['arSubAction']['allgemein'] = array(
 				'Menutext' => __('Allgemein', 'wpsg'),
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/konfiguration.phtml'
-			);			
+			);
 			$this->shop->view['arSubAction']['shopdata'] = array(
 				'Menutext' => __('Shopinfo', 'wpsg'),
@@ -95,15 +95,15 @@
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/extended.phtml'
 			);
-			
-			if (function_exists('icl_object_id')) 
-			{
-				
+
+			if (function_exists('icl_object_id'))
+			{
+
 				$this->shop->view['arSubAction']['wpml'] = array(
 					'Menutext' => __('WPML Einstellungen', 'wpsg'),
 					'subTemplate' => WPSG_PATH_VIEW.'/admin/wpml.phtml'
-				);	
-				
-			}
-			
+				);
+
+			}
+
 			$this->shop->view['arSubAction']['presentation'] = array(
 				'Menutext' => __('Darstellung', 'wpsg'),
@@ -114,12 +114,12 @@
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/loadsavesettings.phtml'
 			);
-						
+
 			if ($this->shop->isMultiBlog() && is_super_admin())
 			{
-				
+
 				$this->shop->view['arSubAction']['blognetzwerk'] = array(
 					'Menutext' => __('Blognetzwerk', 'wpsg'),
 					'subTemplate' => WPSG_PATH_VIEW.'/admin/blognetzwerk.phtml'
-				);	
+				);
 
 				// Wenn da spÃ€ter mal mehr drin ist als der Multiblog Pfad dann sollte das aus dem If raus!
@@ -128,7 +128,7 @@
 					'subTemplate' => WPSG_PATH_VIEW.'/admin/path.phtml'
 				);
-				
-			}
-			
+
+			}
+
 			$this->shop->view['arSubAction']['kalkulation'] = array(
 				'Menutext' => __('Preiskalkulation', 'wpsg'),
@@ -146,5 +146,5 @@
 				'Menutext' => __('Bibliotheken/Includes', 'wpsg'),
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/includes.phtml'
-			);			
+			);
 			$this->shop->view['arSubAction']['seiten'] = array(
 				'Menutext' => __('Seitenkonfiguration', 'wpsg'),
@@ -171,25 +171,25 @@
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/laender.phtml'
 			);
-			
+
 			if (!$this->shop->isMultiBlog() || is_super_admin())
 			{
-			
+
 				$this->shop->view['arSubAction']['deinstallieren'] = array(
 					'Menutext' => __('Deinstallieren', 'wpsg'),
 					'subTemplate' => WPSG_PATH_VIEW.'/admin/deinstall.phtml'
 				);
-				
-			}
-			
+
+			}
+
 			if (isset($_REQUEST['submit'])) { $this->submitAction(); }
-			
+
 			if (isset($_REQUEST['subaction']))
 			{
-				
+
 				if (method_exists($this, $_REQUEST['subaction'].'Action')) { call_user_func(array($this, $_REQUEST['subaction'].'Action')); }
-				
+
 				$this->shop->view['subAction'] = $_REQUEST['subaction'];
 				$this->shop->view['subTemplate'] = $this->shop->view['arSubAction'][$_REQUEST['subaction']]['subTemplate'];
-				
+
 			}
 			else
@@ -198,47 +198,47 @@
 				if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'update') { $this->updateAction(); }
 				else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'loadHelp') { $this->loadHelpAction(); }
-								
+
 				$this->shop->view['subAction'] = 'allgemein';
-				
-			}
-			
+
+			}
+
 			// Korrektur der Serialisierten Einstellungen beim Aufruf der Allgemein Seite
 			if ($this->shop->view['subAction'] == 'allgemein')
 			{
-				
+
 				$arLanguages = $this->shop->getStoreLanguages();
-				
+
 				$this->shop->view['arLanguages'] = array();
-				
+
 				if (wpsg_isSizedArray($arLanguages))
 				{
-					
+
 					foreach ($arLanguages as $lang)
 					{
-					
+
 						$this->shop->view['arLanguages'][$lang['lang']] = $lang['name'];
-						
+
 					}
-					
-				}
-								
+
+				}
+
 				$this->CheckAndCorrectSerOption();
-				
-			}
-			
+
+			}
+
 			$this->shop->callMods('admin_index', array($this));
 			$this->shop->view['adminController'] = &$this;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');
-			
+
 		} // public function indexAction()
 
 		private function downloadLicenceAction()
 		{
-			
+
 			wpsg_header::startDownloadContent('key.txt', $this->shop->get_option('wpsg_key'));
-			
+
 		} // private function downloadLicenceAction()
-		
+
 		/**
 		 * Beim Speichern und Anzeigen der Shopdatne
@@ -246,9 +246,9 @@
 		public function shopdataAction()
 		{
-			
+
 			if (isset($_REQUEST['submit']))
 			{
-				
-				$this->shop->update_option('wpsg_shopdata_name', $_REQUEST['wpsg_shopdata_name'], false, true); 
+
+				$this->shop->update_option('wpsg_shopdata_name', $_REQUEST['wpsg_shopdata_name'], false, true);
 				$this->shop->update_option('wpsg_shopdata_owner', $_REQUEST['wpsg_shopdata_owner'], false, true);
 				$this->shop->update_option('wpsg_shopdata_tel', $_REQUEST['wpsg_shopdata_tel'], false, true);
@@ -257,34 +257,34 @@
 				$this->shop->update_option('wpsg_shopdata_taxnr', $_REQUEST['wpsg_shopdata_taxnr'], false, true);
 				$this->shop->update_option('wpsg_shopdata_ustidnr', $_REQUEST['wpsg_shopdata_ustidnr'], false, true);
-				
+
 				$this->shop->update_option('wpsg_shopdata_street', $_REQUEST['wpsg_shopdata_street'], false, true);
 				$this->shop->update_option('wpsg_shopdata_zip', $_REQUEST['wpsg_shopdata_zip'], false, true);
 				$this->shop->update_option('wpsg_shopdata_city', $_REQUEST['wpsg_shopdata_city'], false, true);
-				
+
 				$this->shop->update_option('wpsg_shopdata_bank_name', $_REQUEST['wpsg_shopdata_bank_name'], false, true);
 				$this->shop->update_option('wpsg_shopdata_bank_owner', $_REQUEST['wpsg_shopdata_bank_owner'], false, true);
 				$this->shop->update_option('wpsg_shopdata_bank_iban', $_REQUEST['wpsg_shopdata_bank_iban'], false, true);
 				$this->shop->update_option('wpsg_shopdata_bank_bic', $_REQUEST['wpsg_shopdata_bank_bic'], false, true);
-				
+
 				$this->addBackendMessage(__('Shopdaten erfolgreich gespeichert.', 'wpsg'));
-				
+
 				$this->shop->update_option('wpsg_message_shopdata_change', false);
-				
+
 				if ($this->shop->get_option('wpsg_revocationform') != false && !array_key_exists('wpsg_message_shopdata', (array)$_SESSION['wpsg']['backendError']))
 				{
-				
+
 					$this->shop->addBackendError('nohspc_'.wpsg_translate(
             			__('Die allgemeinen Daten des Shops haben sich verÃ€ndert, sie sollten das <a href="#1#">Widerrufsformular</a> ÃŒberprÃŒfen bzw. neu generieren.', 'wpsg'),
 						WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=widerrufsbelehrung'
 					), 'wpsg_message_shopdata_change');
-					
-				}
-				
+
+				}
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=shopdata');
-				
-			}
-			
+
+			}
+
 		} // public function shopdataAction()
-		
+
 		/**
 		 * LÃ€dt die Lizenz in die Datenbank wenn valide
@@ -292,98 +292,98 @@
 		public function loadLicenceAction()
 		{
-		 
+
 			if (file_exists($_FILES['wpsg_licence_file']['tmp_name']))
 			{
-				 
+
 				if (!file_exists(WPSG_PATH.'/lib/.htpublic'))
 				{
-					
+
 					$this->addBackendError(base64_decode('w5ZmZmVudGxpY2hlciBTY2hsw7xzc2VsIGV4aXN0aWVydCBuaWNodCE=')); // Ãffentlicher SchlÃŒssel existiert nicht!
-					
+
 				}
 				else
 				{
-				
-					if (!class_exists('Crypt_RSA')) 
+
+					if (!class_exists('Crypt_RSA'))
 					{
 
 						@set_include_path(WPSG_PATH.'/lib/phpseclib0.3.0/'.PATH_SEPARATOR.get_include_path());
 						require_once(WPSG_PATH.'/lib/phpseclib0.3.0/Crypt/RSA.php');
-						
+
 					}
-					 
+
 					$rsa = new Crypt_RSA();
 					$load = $rsa->loadKey(file_get_contents(WPSG_PATH.'/lib/.htpublic'));
-					
+
 					if ($load === false)
 					{
-						
+
 						$this->addBackendMessage(base64_decode('TGFkZW4gZGVzIMO2ZmZlbnRsaWNoZW4gU2NobMO8c3NlbHMgaXN0IGZlaGxnZXNjaGxhZ2VuLg==')); // Laden des Ã¶ffentlichen SchlÃŒssels ist fehlgeschlagen.
-						
+
 					}
 					else
 					{
-				 
+
 						$decrypt_key = $rsa->decrypt(base64_decode(file_get_contents($_FILES['wpsg_licence_file']['tmp_name'])));
-						
+
 						if ($decrypt_key === false)
 						{
-							
+
 							$this->addBackendError(base64_decode('RW50c2NobMO8c3NlbG4gZmVobGdlc2NobGFnZW4=')); // EntschlÃŒsseln fehlgeschlagen
-							
+
 						}
 						else
 						{
-						
+
 							$arKey = @unserialize($decrypt_key);
-							  
+
 							if (is_array($arKey) && $arKey['l'] < 3 && $this->shop->isMultiBlog())
 							{
-								
+
 								$this->shop->update_option('wpsg_key', false, true);
 								$this->addBackendError(base64_decode('RsO8ciBkaWUgVmVyd2VuZHVuZyBpbiBlaW5lciBNdWx0aWJsb2cgVW1nZWJ1bmcgaXN0IGRpZSBFbnRlcnByaXNlIExpemVueiBuw7Z0aWcu')); // FÃŒr die Verwendung in einer Multiblog Umgebung ist die Enterprise Lizenz nÃ¶tig.
-								
+
 							}
 							else
 							{
-							
+
 								if (is_array($arKey) && $arKey['anwendung'] == 'wpShopGermany')
 								{
-				
+
 									$this->shop->clearMessages();
-									
+
 									// Key ist gÃŒltig und nun installieren
 									$this->shop->update_option('wpsg_key', file_get_contents($_FILES['wpsg_licence_file']['tmp_name']), true);
 									$this->addBackendMessage(base64_decode('S2V5IHd1cmRlIGVyZm9sZ3JlaWNoIGluc3RhbGxpZXJ0')); // Key wurde erfolgreich installiert
-									
+
 								}
 								else
 								{
-									
+
 									$this->addBackendError(base64_decode('VW5nw7xsdGlnZSBMaXplbnpkYXRlaQ==')); // UngÃŒltige Lizenzdatei
-										
+
 								}
-								
+
 							}
-							
+
 						}
-						
+
 					}
-					
-				}
-									
+
+				}
+
 				if ($this->shop->isMultiBlog()) die($this->redirect(WPSG_URL_WP.'wp-admin/network/plugins.php'));
 				else die($this->redirect(WPSG_URL_WP.'wp-admin/plugins.php'));
-				
+
 			}
 			else
 			{
-				
+
 				$this->addBackendError(base64_decode('S2VpbmUgTGl6ZW56ZGF0ZWkgYW5nZWdlYmVu')); // Keine Lizenzdatei angegeben
-				
-			}
-			
+
+			}
+
 		} // public function loadLicenceAction()
-				
+
 		/**
 		 * Verwaltung der Registrierung
@@ -391,9 +391,9 @@
 		public function registrierungAction()
 		{
-									
+
 			return $this->shop->callMod('wpsg_mod_core', 'admin_registrierung');
-			
+
 		} // public function registrierungAction()
-				
+
 		/**
 		 * Gibt die Liste der Versandzonen zurÃŒck
@@ -401,11 +401,11 @@
 		public function vz_listAction()
 		{
-			
+
 			$this->shop->view['data'] = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_VZ."` ORDER BY `name` ASC");
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/admin/versandzonen_list.phtml');
-			
+
 		} // public function vz_listAction()
-		
+
 		/**
 		 * Migriert die alten MehrwertsteuersÃ€tze die vor 3.5 existierten in die LÃ€nder und passt die Produkte an.
@@ -413,99 +413,99 @@
 		public function migratemwstAction()
 		{
-			
+
 			if (isset($_REQUEST['submit']))
 			{
-				 			
+
 				// MehrwertsteuersÃ€tze der Produkte
 				if (wpsg_isSizedArray($_REQUEST['mwst']))
 				{
-				
+
 					foreach ($_REQUEST['mwst'] as $tax_id => $tax_key)
 					{
-						
+
 						if ($tax_id == 0)
 						{
-							
+
 							// Das sind die Produkte mit MwSt SÃ€tzen die nicht mehr exitierten
 							$arProductIDs = $this->db->fetchAssocField("
-								SELECT 
-									P.`id` 
-								FROM 
-									`".WPSG_TBL_PRODUCTS."` AS P 
+								SELECT
+									P.`id`
+								FROM
+									`".WPSG_TBL_PRODUCTS."` AS P
 										LEFT JOIN `".WPSG_TBL_MWST."` AS M ON (P.`mwst` = M.`id`)
 								WHERE
-									M.`id` IS NULL AND 
+									M.`id` IS NULL AND
 									(P.`mwst_key` = '' OR P.`mwst_key` IS NULL)
 							");
-							
+
 							$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, array('mwst_key' => wpsg_q($tax_key)), " `id` IN (".implode(',', wpsg_q($arProductIDs)).") ");
-							
+
 						}
-						else 
+						else
 						{
-							
+
 							$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, array('mwst_key' => wpsg_q($tax_key)), " (`mwst_key` = '' OR `mwst_key` IS NULL) AND `mwst` = '".wpsg_q($tax_id)."' ");
-							
+
 						}
-						
+
 					}
-					
-				}
-				
+
+				}
+
 				// Konfiguration speichern
 				if (wpsg_isSizedArray($_REQUEST['conf']))
 				{
-					
+
 					foreach ($_REQUEST['conf'] as $conf_key => $conf_value)
 					{
-						
+
 						$this->shop->update_option($conf_key, $conf_value);
-						
+
 					}
-					
-				}
-				
+
+				}
+
 				// Zahlungsvarianten
 				if (wpsg_isSizedArray($_REQUEST['pv']))
 				{
-					
+
 					foreach ($_REQUEST['pv'] as $pv_id => $tax_key)
 					{
-						
+
 						$this->db->UpdateQuery(WPSG_TBL_ZV, array('mwst_key' => wpsg_q($tax_key)), " `id` = '".wpsg_q($pv_id)."' ");
-						
+
 					}
-					
-				}
-				
+
+				}
+
 				// Versandarten
 				if (wpsg_isSizedArray($_REQUEST['sv']))
 				{
-						
+
 					foreach ($_REQUEST['sv'] as $sv_id => $tax_key)
 					{
-				
+
 						$this->db->UpdateQuery(WPSG_TBL_VA, array('mwst_key' => wpsg_q($tax_key)), " `id` = '".wpsg_q($sv_id)."' ");
-				
+
 					}
-						
-				}
-				
+
+				}
+
 				$this->shop->removePersistentBackendError('wpsg_update_3.5_1');
-				
+
 				$this->shop->addBackendMessage(__('Migration der MwSt. SÃ€tze erfolgreich durchgefÃŒhrt.', 'wpsg'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=hilfe');
-				
-			}
-			
+
+			}
+
 			$this->shop->view = array(
 				'actionName' => 'hilfe',
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/migratemwst.phtml'
 			);
-			
+
 			$arMwStTable = $this->db->fetchAssocField("SHOW TABLES LIKE '".WPSG_TBL_MWST."'");
 			if (in_array(WPSG_TBL_MWST, $arMwStTable))
 			{
-			
+
 				$this->shop->view['distinctProductTax'] = $this->db->fetchAssoc("
 					SELECT
@@ -517,13 +517,13 @@
 					WHERE
 						P.`mwst_key` = '' OR P.`mwst_key` IS NULL
-					GROUP BY 
-						M.`id`	
+					GROUP BY
+						M.`id`
 				");
 
 			}
-			
-			if ($this->shop->hasMod('wpsg_mod_userpayment')) 
-			{
-				
+
+			if ($this->shop->hasMod('wpsg_mod_userpayment'))
+			{
+
 				$this->shop->view['arPaymentMethods'] = $this->db->fetchAssoc("
 					SELECT
@@ -532,12 +532,12 @@
 						`".WPSG_TBL_ZV."` AS PM
 					WHERE
-						PM.`mwst_key` = '' OR PM.`mwst_key` IS NULL 
+						PM.`mwst_key` = '' OR PM.`mwst_key` IS NULL
 				");
-			
-			}
-			
+
+			}
+
 			if ($this->shop->hasMod('wpsg_mod_versandarten'))
 			{
-			
+
 				$this->shop->view['arShippingMethods'] = $this->db->fetchAssoc("
 					SELECT
@@ -548,9 +548,9 @@
 						SM.`mwst_key` = '' OR SM.`mwst_key` IS NULL
 				");
-				
-			}
-			 			
+
+			}
+
 			$this->shop->view['arConf'] = array();
-			
+
 			if (wpsg_isSizedInt($this->get_option('wpsg_mod_paypal_mwst'))) { $this->shop->view['arConf']['wpsg_mod_paypal_mwst'] = __('Mehrwertsteuersatz fÃŒr PayPal GebÃŒhren', 'wpsg'); }
 			if (wpsg_isSizedInt($this->get_option('wpsg_mod_paypal_mwst'))) { $this->shop->view['arConf']['wpsg_mod_autodebit_mwst'] = __('Mehrwertsteuersatz fÃŒr Bankeinzugs GebÃŒhren', 'wpsg'); }
@@ -578,24 +578,24 @@
 			if (wpsg_isSizedInt($this->get_option('wpsg_mod_paypal_mwst'))) { $this->shop->view['arConf']['wpsg_mod_su_mwst'] = __('Mehrwertsteuersatz fÃŒr SofortÃŒberweisungsgebÃŒhren', 'wpsg'); }
 			if (wpsg_isSizedInt($this->get_option('wpsg_mod_paypal_mwst'))) { $this->shop->view['arConf']['wpsg_mod_willcollect_mwst'] = __('Mehrwertsteuersatz fÃŒr GebÃŒhren der Selbstabholung', 'wpsg'); }
-			
+
 			$this->shop->view['defaultCountry'] = $this->shop->getDefaultCountry();
-			
-			if (	!wpsg_isSizedArray($this->shop->view['distinctProductTax']) && 
-					!wpsg_isSizedArray($this->shop->view['arPaymentMethods']) && 
+
+			if (	!wpsg_isSizedArray($this->shop->view['distinctProductTax']) &&
+					!wpsg_isSizedArray($this->shop->view['arPaymentMethods']) &&
 					!wpsg_isSizedArray($this->shop->view['arShippingMethods']) &&
-					!wpsg_isSizedArray($this->shop->view['arConf'])	)				
-			{
-				
+					!wpsg_isSizedArray($this->shop->view['arConf'])	)
+			{
+
 				$this->shop->removePersistentBackendError("wpsg_update_3.5_1");
 				$this->shop->addBackendError(__('Es gibt keine alten MwSt. SÃ€tze zu migrieren.', 'wpsg'));
-				
+
 				$this->shop->view['subTemplate'] = WPSG_PATH_VIEW.'/admin/hilfe.phtml';
-						
-			}
-			
-			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');		
-			
+
+			}
+
+			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');
+
 		}
-		
+
 		/**
 		 * Wird aufgerufen wenn die Versandzonen verwaltet werden sollen
@@ -603,80 +603,80 @@
 		public function vzAction()
 		{
-			
+
 			if (isset($_REQUEST['submit']))
 			{
-				
+
 				$this->shop->removePersistentBackendError('wpsg_update_3.5_2');
-				
+
 				$this->shop->addBackendMessage(__('Einstellungen der Versandzonen wurden erfolgreich gespeichert.', 'wpsg'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz');
-					
-			}
-			
+
+			}
+
 			$this->shop->view['arVZ'] = $this->db->fetchAssocField("SELECT VZ.`id`, VZ.`name` FROM `".WPSG_TBL_VZ."` AS VZ WHERE 1 ORDER BY VZ.`name` ASC ", "id", "name");
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
 			{
-				
+
 				// Neue Zone anlegen
 				$new_name = __('Anklicken um Bezeichnung zu Ã€ndern ...', 'wpsg');
-				
+
 				$vz_id = $this->db->ImportQuery(WPSG_TBL_VZ, array(
 					'name' => wpsg_q($new_name)
 				));
-				
+
 				$this->shop->addTranslationString('vz_'.$vz_id, $new_name);
-				
+
 				die($this->vz_listAction());
-				
+
 			}
 			else if (@$_REQUEST['do'] == 'loadStandard')
 			{
-			
+
 				$this->loadStandardLaenderVz();
-			
+
 				die($this->vz_listAction());
-			
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
 			{
-				
+
 				// Versandzone lÃ¶schen
 				$this->db->Query("DELETE FROM `".WPSG_TBL_VZ."` WHERE `id` = '".wpsg_q($_REQUEST['vz_id'])."'");
-				
+
 				die($this->vz_listAction());
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'inlinedit')
 			{
-				
+
 				// Inline Edit
 				$data = array();
-				
+
 				$data[$_REQUEST['field']] = wpsg_q($_REQUEST['value']);
-				
+
 				if ($_REQUEST['field'] == 'name')
 				{
 					$this->shop->addTranslationString('vz_'.$_REQUEST['vz_id'], $_REQUEST['value']);
 				}
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_VZ, $data, "`id` = '".wpsg_q($_REQUEST['vz_id'])."'");
-				
+
 				die(stripslashes($_REQUEST['value']));
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save_plz')
 			{
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_VZ, array(
 					'param' => trim($_REQUEST['textarea'])
 				), "`id` = '".wpsg_q($_REQUEST['vz_id'])."'");
-				
+
 				die('1');
-				
-			}
-			
+
+			}
+
 		} // public function vzAction()
-		 
+
 		/**
 		 * Ist fÃŒr das Deinstallieren zustÃ€ndig
@@ -684,83 +684,83 @@
 		public function deinstallierenAction()
 		{
-			
+
 			global $wpdb;
-			
+
 			if (isset($_REQUEST['submit']))
 			{
-				
+
 				if ($_REQUEST['wpsg_deinstall_products'] == '1')
 				{
-					
+
 					// Produkte lÃ¶schen
 					$this->db->Query("TRUNCATE TABLE `".WPSG_TBL_PRODUCTS."`");
 					$this->db->Query("DELETE FROM `".WPSG_TBL_META."` WHERE `meta_table` = 'WPSG_TBL_PRODUCTS' ");
-					
+
 					$this->shop->addBackendMessage(__('Produkte erfolgreich gelÃ¶scht.', 'wpsg'));
-					
-				}
-				
+
+				}
+
 				if ($_REQUEST['wpsg_deinstall_customer'] == '1')
 				{
-					
+
 					// Kunden lÃ¶schen
 					$this->db->Query("TRUNCATE TABLE `".WPSG_TBL_KU."`");
 					$this->db->Query("DELETE FROM `".WPSG_TBL_META."` WHERE `meta_table` = 'WPSG_TBL_KU' ");
-					
+
 					$this->shop->addBackendMessage(__('Kunden erfolgreich gelÃ¶scht.', 'wpsg'));
-					
-				}
-				
+
+				}
+
 				if ($_REQUEST['wpsg_deinstall_order'] == '1')
 				{
-					
+
 					// Bestellungen lÃ¶schen
 					$arOrder = wpsg_order::find(array());
-					
+
 					foreach ($arOrder as $oOrder)
 					{
-						
+
 						$oOrder->delete();
-						
+
 					}
-					
+
 					$this->shop->addBackendMessage(__('Bestellungen erfolgreich gelÃ¶scht.', 'wpsg'));
-					
-				}
-				
+
+				}
+
 				if ($_REQUEST['wpsg_deinstall_incompleteorder'] == '1')
 				{
-				
+
 					$arOrder = wpsg_order::find(array(
 						'status' => wpsg_ShopController::STATUS_UNVOLLSTAENDIG
 					));
-					
+
 					foreach ($arOrder as $oOrder)
 					{
-						
+
 						$oOrder->delete();
-						
+
 					}
-					
+
 					$this->shop->addBackendMessage(__('UnvollstÃ€ndige Bestellungen erfolgreich gelÃ¶scht.', 'wpsg'));
-					
-				}
-				
+
+				}
+
 				if ($_REQUEST['wpsg_deinstall_core'] == '1')
 				{
-					
+
 					// Tabellen lÃ¶schen
 					foreach ((array)get_defined_constants() as $const_key => $const)
 					{
-						
+
 						if (preg_match('/^WPSG_TBL_(.*)/', $const_key))
 						{
-							
+
 							$this->db->Query("DROP TABLE IF EXISTS `".$const."`");
-							
+
 						}
-						
+
 					}
-										
+
 					// Plugin deaktivieren
 					deactivate_plugins(WPSG_FOLDERNAME.'/wpshopgermany.php');
@@ -768,28 +768,28 @@
 					// Einstellungen lÃ¶schen
 					$this->db->Query("DELETE FROM `".$wpdb->prefix."options` WHERE `option_name` LIKE 'wpsg_%'");
-					
+
 					// Plugindaten lÃ¶schen
 					wpsg_rrmdir(WP_PLUGIN_DIR.'../'.WPSG_FOLDERNAME.'/');
-					
-					$this->shop->clearMessages();					
+
+					$this->shop->clearMessages();
 					$this->shop->redirect(WPSG_URL_WP.'wp-admin/plugins.php');
-					
+
 				}
 				else
 				{
-				
+
 					$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&amp;subaction=deinstallieren');
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			$this->shop->view['count_order_incomplete'] = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_ORDER."` WHERE `status` = '".wpsg_q(wpsg_ShopController::STATUS_UNVOLLSTAENDIG)."' ");
 			$this->shop->view['count_order'] = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_ORDER."`");
 			$this->shop->view['count_customer'] = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_KU."`");
 			$this->shop->view['count_products'] = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS."`");
-			
+
 		} // public function deinstallierenAction()
-		
+
 		/**
 		 * Wird aufgerufen wenn die LÃ€nder verwaltet werden sollen
@@ -797,5 +797,5 @@
 		public function laenderAction()
 		{
-			
+
 			if (isset($_REQUEST['submit']))
 			{
@@ -824,5 +824,5 @@
 
 			}
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save')
 			{
@@ -832,5 +832,5 @@
 				if (wpsg_isSizedInt($form_data['id']))
 				{
-										
+
 					$this->db->UpdateQuery(WPSG_TBL_LAND, wpsg_q($form_data['country']), " `id` = '".wpsg_q($form_data['id'])."' ");
 					$this->addBackendMessage(__('Land erfolgreich gespeichert.', 'wpsg'));
@@ -845,16 +845,16 @@
 				}
 
-				$this->shop->addTranslationString('land_'.$form_data['id'], $form_data['country']['name']); 
-				 
+				$this->shop->addTranslationString('land_'.$form_data['id'], $form_data['country']['name']);
+
 				//icl_register_string('wpsg', '', $form_data['country']['name']);
-				
+
 				if (wpsg_isSizedInt($form_data['standard'])) $this->update_option('wpsg_defaultland', $form_data['id']);
 
 				die($this->laenderList());
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'eu_import')
 			{
-				
+
 				// EU Import
 				$this->loadEULaender();
@@ -862,14 +862,14 @@
 
 				die($this->laenderList());
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'import')
 			{
-								
+
 				$this->loadStandardLaenderVz();
 				$this->shop->addBackendMessage(__('LÃ€nder erfolgreich importiert.', 'wpsg'));
 
 				die($this->laenderList());
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
@@ -879,7 +879,7 @@
 				$oCountry = wpsg_country::getInstance($_REQUEST['land_id']);
 				$oCountry->delete();
-				
+
 				die("1");
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
@@ -900,79 +900,79 @@
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'edit')
 			{
-			
+
 				$this->shop->view['vz'] = $this->db->fetchAssocField("SELECT `id`, `name` FROM `".WPSG_TBL_VZ."` ORDER BY `name` ASC", "id", "name");
 				$this->shop->view['land'] = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($_REQUEST['land_id'])."' ");
 
-				if (wpsg_tf($this->shop->view['land']['mwst_a']) >= 0 && wpsg_tf($this->shop->view['land']['mwst_a']) !== '') $this->shop->view['land']['mwst_a'] = wpsg_ff(wpsg_tf($this->shop->view['land']['mwst_a']), '%'); else $this->shop->view['land']['mwst_a'] = ''; 
+				if (wpsg_tf($this->shop->view['land']['mwst_a']) >= 0 && wpsg_tf($this->shop->view['land']['mwst_a']) !== '') $this->shop->view['land']['mwst_a'] = wpsg_ff(wpsg_tf($this->shop->view['land']['mwst_a']), '%'); else $this->shop->view['land']['mwst_a'] = '';
 				if (wpsg_tf($this->shop->view['land']['mwst_b']) >= 0 && wpsg_tf($this->shop->view['land']['mwst_b']) !== '') $this->shop->view['land']['mwst_b'] = wpsg_ff(wpsg_tf($this->shop->view['land']['mwst_b']), '%'); else $this->shop->view['land']['mwst_b'] = '';
 				if (wpsg_tf($this->shop->view['land']['mwst_c']) >= 0 && wpsg_tf($this->shop->view['land']['mwst_c']) !== '') $this->shop->view['land']['mwst_c'] = wpsg_ff(wpsg_tf($this->shop->view['land']['mwst_c']), '%'); else $this->shop->view['land']['mwst_c'] = '';
 				if (wpsg_tf($this->shop->view['land']['mwst_d']) >= 0 && wpsg_tf($this->shop->view['land']['mwst_d']) !== '') $this->shop->view['land']['mwst_d'] = wpsg_ff(wpsg_tf($this->shop->view['land']['mwst_d']), '%'); else $this->shop->view['land']['mwst_d'] = '';
-								
+
 				if ($this->shop->get_option('wpsg_defaultland') == $_REQUEST['land_id']) $this->shop->view['land']['standard'] = '1'; else $this->shop->view['land']['standard'] = '0';
-				
+
 				die($this->shop->render(WPSG_PATH_VIEW.'/admin/laender_edit.phtml'));
-			
-			}
-			
+
+			}
+
 			$this->shop->removePersistentBackendError('wpsg_update_3.5_3');
-			
+
 			$this->shop->view['vz'] = $this->db->fetchAssocField("SELECT `id`, `name` FROM `".WPSG_TBL_VZ."` ORDER BY `name` ASC", "id", "name");
 			$this->shop->view['data'] = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_LAND."` ORDER BY `vz` ASC, `name` ASC");
-					 	
+
 		} // public function laenderAction()
 
-		public function wpmlAction() 
-		{
-			
+		public function wpmlAction()
+		{
+
 			if (isset($_REQUEST['wpsg_set_string_translation']))
 			{
-				
+
 				if (!function_exists('icl_register_string')) throw new \wpsg\Exception(__('WPML ist nicht komplett Installiert (Funktion icl_register_string ist nicht erreichbar)', 'wpsg'));
-			
+
 				// Alle Automatisch angelegten String-Ãbersetzungen lÃ¶schen
 				$arStringTrans = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_WPML_ICL_STRINGS."` WHERE `context` = 'wpsg' AND `name` LIKE 'wpsg_auto_%' ");
-				
+
 				foreach ($arStringTrans as $st_id)
 				{
-					
-					// LÃ¶schen						
+
+					// LÃ¶schen
 					$this->db->Query("DELETE FROM `".WPSG_TBL_WPML_ICL_STRING_PAGES."` WHERE `string_id` = '".wpsg_q($st_id)."' ");
 					$this->db->Query("DELETE FROM `".WPSG_TBL_WPML_ICL_STRING_POSITIONS."` WHERE `string_id` = '".wpsg_q($st_id)."' ");
 					$this->db->Query("DELETE FROM `".WPSG_TBL_WPML_ICL_STRING_TRANSLATIONS."` WHERE `string_id` = '".wpsg_q($st_id)."' ");
 					$this->db->Query("DELETE FROM `".WPSG_TBL_WPML_ICL_STRINGS."` WHERE `id` = '".wpsg_q($st_id)."' ");
-									
-				}
-				
+
+				}
+
 				// LÃ€ndernamen
 				$arToTrans = $this->db->fetchAssocField("SELECT CONCAT('land_', `id`) AS `key`, `name` FROM `".WPSG_TBL_LAND."` ", "key", "name");
-				
+
 				// Versandzonen
 				$arToTrans += $this->db->fetchAssocField("SELECT CONCAT('vz_', `id`) AS `key`, `name` FROM `".WPSG_TBL_VZ."` ", "key", "name");
-				
+
 				// Auswahl der Anrede
 				$wpsg_admin_pflicht = $this->shop->get_option('wpsg_admin_pflicht');
 				$arToTrans['anrede_auswahl'] = $wpsg_admin_pflicht['anrede_auswahl'];
-				
+
 				// Text Widerrufsmail
 				$arToTrans['wpsg_ps_mailwiderruf'] = $this->shop->get_option('wpsg_ps_mailwiderruf');
-				
+
 				// Module
 				// TODO
-				
+
 				foreach ($arToTrans as $k => $t)
 				{
-					
+
 					icl_register_string('wpsg', 'wpsg_auto_'.$k, $t, false, 'de');
-					
-				}
-				 				
-				$this->addBackendMessage(wpsg_translate(__('#1# Texte zur String-Ãbersetzung der Domain "wpsg" hinzugefÃŒgt.'), sizeof($arToTrans)));			 
-				
+
+				}
+
+				$this->addBackendMessage(wpsg_translate(__('#1# Texte zur String-Ãbersetzung der Domain "wpsg" hinzugefÃŒgt.'), sizeof($arToTrans)));
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=wpml');
-				
-			}
-			
+
+			}
+
 		} // public function wpmlAction()
-		
+
 		private function laenderList()
 		{
@@ -991,20 +991,20 @@
 		public function loadEULaender()
 		{
-			 
+
 			$handle = fopen(WPSG_PATH."/lib/data/wp_wpsg_laender.csv", "r");
-			
+
 			// Schauen ob die EU Versandzone existiert
 			$nExists = $this->db->fetchOne("SELECT VZ.`id` FROM `".WPSG_TBL_VZ."` AS VZ WHERE VZ.`id` = '2' ");
 			if (!wpsg_isSizedInt($nExists)) $this->db->ImportQuery(WPSG_TBL_VZ, array(
-				'id' => '2', 
+				'id' => '2',
 				'name' => __('EU', 'wpsg'),
-				'innereu' => '1'				
+				'innereu' => '1'
 			));
-			
+
 			while (($row = fgetcsv($handle, 1000, ";")) !== false)
 			{
-				 
+
 				if (!in_array($row['3'], array(1, 2))) continue;
-				
+
 				$country_data = array(
 					'id' => wpsg_q($row['0']),
@@ -1018,30 +1018,30 @@
 					'mwst_d' => ((wpsg_tf($row[8]) >= 0 && wpsg_tf($row[8]) !== '')?wpsg_q(wpsg_tf($row[8])):'NULL')
 				);
-				
+
 				$nExists = $this->db->fetchOne("SELECT L.`id` FROM `".WPSG_TBL_LAND."` AS L WHERE UPPER(L.`name`) = '".wpsg_q(strtoupper($country_data['name']))."' ");
-												
+
 				if (wpsg_isSizedInt($nExists))
 				{
-					
+
 					unset($country_data['id']);
 					$this->db->UpdateQuery(WPSG_TBL_LAND, $country_data, " `id` = '".wpsg_q($nExists)."' ");
-					
+
 				}
 				else
 				{
-					
+
 					// Checken ob die ID schon existiert.
 					$idName = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($country_data['id'])."' ");
-					
+
 					if (wpsg_isSizedInt($idName)) unset($country_data['id']);
-					
+
 					$this->db->ImportQuery(WPSG_TBL_LAND, $country_data);
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 		} // public function loadEULaender()
-		
+
 		/**
 		 * Diese Funktion lÃ€dt die Standard LÃ€nder und Versandzonen
@@ -1049,24 +1049,24 @@
 		 */
 		private function loadStandardLaenderVz()
-		{ 
-			
+		{
+
 			// Standard LÃ€nder und Versandzonen laden
 			$this->db->Query("DELETE FROM `".WPSG_TBL_VZ."`");
 			$this->db->Query("DELETE FROM `".WPSG_TBL_LAND."`");
-			
+
 			// Versandzonen anlegen
 			$this->db->ImportQuery(WPSG_TBL_VZ, array('id' => '1', 'name' => __('Inland', 'wpsg')));
 			$this->db->ImportQuery(WPSG_TBL_VZ, array('id' => '2', 'name' => __('EU LÃ€nder', 'wpsg'), 'innereu' => '1'));
 			$this->db->ImportQuery(WPSG_TBL_VZ, array('id' => '3', 'name' => __('Ausland', 'wpsg')));
-			
+
 			$this->shop->addTranslationString('vz_1', __('Inland', 'wpsg'));
 			$this->shop->addTranslationString('vz_2', __('EU LÃ€nder', 'wpsg'));
 			$this->shop->addTranslationString('vz_3', __('Ausland', 'wpsg'));
-			
+
 			$handle = fopen(WPSG_PATH."/lib/data/wp_wpsg_laender.csv", "r");
-			
+
 			while (($row = fgetcsv($handle, 1000, ";")) !== false)
 			{
-				
+
 				$land_id = $this->db->ImportQuery(WPSG_TBL_LAND, array(
 					'id' => wpsg_q($row['0']),
@@ -1080,14 +1080,14 @@
 					'mwst_d' => ((wpsg_tf($row[8]) >= 0 && wpsg_tf($row[8]) !== '')?wpsg_q(wpsg_tf($row[8])):'NULL')
 				));
-									
-				$this->shop->addTranslationString('land_'.$land_id, $row['1']); 
-					
-			}
-			
+
+				$this->shop->addTranslationString('land_'.$land_id, $row['1']);
+
+			}
+
 			$this->shop->update_option('wpsg_defaultland', '1');
-			
+
 		} // private function loadStandardLaenderVz()
- 
-		
+
+
 		/**
 		 * Wird aufgerufen wenn die Zahlungsart verÃ€ndert wird
@@ -1105,5 +1105,5 @@
 			{
 				//'wp-admin/admin.php?page=wpsg-Admin&subaction=paymentData&do=change&edit_id=12&p_id=34&p_value=56&noheader=1';
-			
+
 				$arTaxKey = explode('_', wpsg_q($_REQUEST['mwst']));
 				$country_id = $arTaxKey[1];
@@ -1125,5 +1125,5 @@
 					$valb = $pval;
 				}
-				
+
 				$data = array('price_payment' => $pval, 'price_payment_brutto' => $valb, 'price_payment_netto' => $valn,
 						      'type_payment' => $pid);
@@ -1138,7 +1138,7 @@
 				}
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-			
-			}
-		
+
+			}
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
@@ -1151,5 +1151,5 @@
 			//$taxp = $bc->addMwSt($this->shop->view['basket'], $pval);
 			//$taxp = abs($taxp);
-				
+
 			if ($option == WPSG_NETTO)
 			{
@@ -1161,14 +1161,14 @@
 			}
 			$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-			
+
 			exit;
-				
+
 		}	// public function paymentDataAction()
-		
+
 		/**
 		 * Wird aufgerufen wenn die Versandart verÃ€ndert wird
@@ -1186,5 +1186,5 @@
 			{
 				//'wp-admin/admin.php?page=wpsg-Admin&subaction=shippingData&do=change&edit_id=12&p_id=34&p_value=56&noheader=1';
-					
+
 				$arTaxKey = explode('_', wpsg_q($_REQUEST['mwst']));
 				$country_id = $arTaxKey[1];
@@ -1204,12 +1204,12 @@
 				}
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-					
-			}
-		
+
+			}
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			if ($option == WPSG_NETTO)
 			{
@@ -1221,14 +1221,14 @@
 			}
 			$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-				
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-				
+
 			exit;
-		
+
 		}	// public function shippingDataAction()
-		
+
 		/**
 		 * Wird aufgerufen wenn die Gutscheine verwaltet werden sollen
@@ -1241,5 +1241,5 @@
 			$option = $this->shop->get_option('wpsg_preisangaben');
 			if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
 			{
@@ -1253,9 +1253,9 @@
 							'cdate' => $dt1, 'start_date' => $dt1, 'end_date' => $dt2);
 				$gs_id = $this->db->ImportQuery(WPSG_TBL_GUTSCHEIN, $gs);
-				
+
 				$ogs = array('gs_id' => $gs_id, 'price_gs' => 10.0);
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
 				$_REQUEST['gs_id'] = $gs_id;
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
@@ -1266,5 +1266,5 @@
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
 				$_REQUEST['gs_id'] = 0;
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editname')
@@ -1281,5 +1281,5 @@
 				//submitdata: { field: 'code', gs_id: 92 }
 				$sval = abs(wpsg_tf($_REQUEST['value']));
-				
+
 				$arTaxKey = explode('_', wpsg_q($_REQUEST['mwst']));
 				$country_id = $arTaxKey[1];
@@ -1299,12 +1299,12 @@
 				}
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
-					
-			}
-			
+
+			}
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editvalue')
 			{
@@ -1319,14 +1319,14 @@
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 			}
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-				
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-				
+
 			exit;
-		
+
 		} // public function voucherDataAction()
-		
+
 		/**
 		 * Wird aufgerufen wenn die Rabatte verwaltet werden sollen
@@ -1339,19 +1339,19 @@
 			$option = $this->shop->get_option('wpsg_preisangaben');
 			if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-				
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
-			{	
+			{
 				if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-		
+
 				$ogs = array('price_rabatt' => 10.0);
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
-		
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
-			{	
+			{
 				// Rabatt lÃ¶schen
 				$ogs = array('price_rabatt' => 0, 'price_rabatt_netto' => 0, 'price_rabatt_brutto' => 0);
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
-		
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editname')
@@ -1359,11 +1359,11 @@
 				//submitdata: { field: 'code', gs_id: 92 }
 				$data = array(wpsg_q($_REQUEST['field']) => wpsg_q($_REQUEST['value']));
-		
+
 				//$this->db->UpdateQuery(WPSG_TBL_GUTSCHEIN, $data, "`id` = '".wpsg_q($_REQUEST['gs_id'])."'");
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editvalue')
-			{	
+			{
 				$sval = abs(wpsg_tf($_REQUEST['value']));
-				
+
 				$arTaxKey = explode('_', wpsg_q($_REQUEST['mwst']));
 				$country_id = $arTaxKey[1];
@@ -1385,10 +1385,10 @@
 
 			}
-			
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-				
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editvalue')
 			{
@@ -1403,12 +1403,12 @@
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 			}
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-		
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-		
+
 			exit;
-		
+
 		} // public function discountDataAction()
 
@@ -1419,14 +1419,14 @@
 		{
 			//die('sendMail');
-			
+
 			$oid = 0;
 			$option = $this->shop->get_option('wpsg_preisangaben');
 			if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-			
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'send')
 			{
@@ -1436,20 +1436,20 @@
 				$this->shop->basket->initFromDB($_REQUEST['edit_id'], true);
 				$arBasket = $this->shop->basket->toArray(true);
-				
+
 				$this->shop->basket->sendOrderSaveMails($_REQUEST['edit_id'], $arBasket, true, false, false);
-				
+
 				$this->shop->addBackendMessage(wpsg_translate(__('Kundenmail wurde erfolgreich an #1# gesendet.', 'wpsg'), $basket->arCheckout['email']));
-				
-			}
-			
+
+			}
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
 
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-			
+
 			exit;
-		
+
 		} // public function sendMailAction()
-		
+
 		/**
 		 * Wird aufgerufen wenn die Produkte bearbeitet werden
@@ -1457,10 +1457,10 @@
 		public function productDataAction()
 		{
-			
+
 			$t1 = 0;
 			$oid = 0;
 			$option = $this->shop->get_option('wpsg_preisangaben');
 			if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-			
+
 			// Steuersatz berechnen
 			$oOrder = wpsg_order::getInstance($oid);
@@ -1469,5 +1469,5 @@
 			$country_id = 1;
 			$country = wpsg_country::getInstance($country_id);
-		
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
 			{
@@ -1475,7 +1475,7 @@
 				if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
 				if (isset($_REQUEST['p_id'])) $pid = wpsg_q($_REQUEST['p_id']);
-				
+
 				$arProd = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($pid)."'");
-				
+
 				$data = array('o_id' => $oid, 'p_id' => $pid, 'productkey' => $pid,
 						'menge' => 1, 'mwst_key' => $arProd['mwst_key'], 'mod_vp_varkey' => $pid,
@@ -1491,5 +1491,5 @@
 					if ($noMwSt === true) $tax_value = 0; else $tax_value = $country->getTax($tax_key);
 				}
-				
+
 				$price = $arProd['preis'];
 
@@ -1498,14 +1498,14 @@
 					$netto = $price;
 					$brutto = $price * ((100.0 + $tax_value) / 100.0);
-					
-				}
-				else 
+
+				}
+				else
 				{
 					$netto = $price / ((100.0 + $tax_value) / 100.0);
 					$brutto = $price;
-					
+
 				}
 				$diff = $brutto - $netto;
-				
+
 				$data['price'] = $price;
 				$data['price_netto'] = $netto;
@@ -1513,5 +1513,5 @@
 				////$data['mwst_value'] = $diff;
 				$data['mwst_value'] = $tax_value;
-				
+
 				$op_id = $this->db->ImportQuery(WPSG_TBL_ORDERPRODUCT, $data);
 				//$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
@@ -1524,7 +1524,7 @@
 				if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
 				if (isset($_REQUEST['op_id'])) $opid = wpsg_q($_REQUEST['op_id']);
-				
+
 				$this->db->Query("DELETE FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `id` = '".wpsg_q($opid)."' ");
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'change')
@@ -1536,5 +1536,5 @@
 
 				$arProd = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($pid)."'");
-				
+
 				$data = array('o_id' => $oid, 'p_id' => $pid, 'productkey' => $pid,
 						'mod_vp_varkey' => $pid,
@@ -1542,8 +1542,8 @@
 						'allowedshipping' => $arProd['allowedshipping'], 'weight' => $arProd['weight']
 				);
-				
+
 				$pval = abs(wpsg_tf($_REQUEST['p_val']));
 				$pme = abs(wpsg_tf($_REQUEST['p_me']));
-				
+
 				$noMwSt = false;
 				if (isset($_REQUEST['noMwSt']))
@@ -1554,12 +1554,12 @@
 					if ($noMwSt === true) $tax_value = 0; else $tax_value = $country->getTax($tax_key);
 				}
-				
+
 				$price = $pval;
-				
+
 				if ($option == WPSG_NETTO)
 				{
 					$netto = $price;
 					$brutto = $price * ((100.0 + $tax_value) / 100.0);
-						
+
 				}
 				else
@@ -1567,8 +1567,8 @@
 					$netto = $price / ((100.0 + $tax_value) / 100.0);
 					$brutto = $price;
-						
+
 				}
 				$diff = $brutto - $netto;
-				
+
 				$data['mwst_key'] = wpsg_q($_REQUEST['p_mwst']);
 				$data['menge'] = $pme;
@@ -1578,24 +1578,24 @@
 				////$data['mwst_value'] = $diff;
 				$data['mwst_value'] = $tax_value;
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_ORDERPRODUCT, $data, "`id` = '".$opid."'");
-				
-			}
-				
+
+			}
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-		
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-		
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-		
+
 			exit;
-		
+
 		} // public function productDataAction()
-		
-		
+
+
 		/**
 		 * Wird aufgerufen wenn die Pflichtfelder verwaltet werden sollen
@@ -1608,23 +1608,23 @@
 			$this->shop->view['arShipping'] = array();
 			foreach ($this->shop->arShipping as $s_id => $s) $this->shop->view['arShipping'][$s['id']] = $s['name'];
-				
+
 			$this->shop->view['arPayment'] = array();
 			foreach ($this->shop->arPayment as $p_id => $p) $this->shop->view['arPayment'][$p['id']] = $p['name'];
-			
+
 			$this->shop->view['arLander'] = $this->db->fetchAssocField("SELECT L.`id`, L.`name` FROM `".WPSG_TBL_LAND."` AS L ORDER BY `name` ASC ", "id", "name");
-			
+
 			$this->shop->view['arTitle'] = (array)explode('|', $this->shop->view['pflicht']['anrede_auswahl']);
-			
+
 			if (isset($_REQUEST['show']) && $_REQUEST['show'] == 'code')
 			{
-				
+
 				$this->shop->view['id'] = $_REQUEST['kv_id'];
 				$this->shop->view['field'] = $this->shop->view['pflicht']['custom'][$_REQUEST['kv_id']];
-				
+
 				die($this->shop->render(WPSG_PATH_VIEW.'/admin/kundendaten_codeinfo.phtml'));
-				
-			}
-			
-			if (isset($_REQUEST['submit'])) 
+
+			}
+
+			if (isset($_REQUEST['submit']))
 			{
 
@@ -1633,10 +1633,10 @@
 				$this->shop->update_option('wpsg_defaultland', $_REQUEST['wpsg_defaultland']);
 				$this->shop->update_option('wpsg_customerpreset_title', $_REQUEST['wpsg_customerpreset_title']);
-				
+
 				$this->update_option('wpsg_kundenvariablen_show', $_REQUEST['wpsg_kundenvariablen_show']);
-				
+
 				foreach ($_REQUEST['pflicht'] as $k => $v)
 				{
-			 
+
 					if ($k == 'custom')
 					{
@@ -1644,5 +1644,5 @@
 						foreach ($_REQUEST['pflicht']['custom'] as $c_id => $c)
 						{
-							
+
 							if (wpsg_getInt($c['del']) == '1')
 								unset($this->shop->view['pflicht']['custom'][$c_id]);
@@ -1652,39 +1652,39 @@
 								// wird jetzt ÃŒber InlineEdit gespeichert
 								$this->shop->view['pflicht']['custom'][$c_id]['typ'] = $c['typ'];
-								$this->shop->view['pflicht']['custom'][$c_id]['show'] = $c['show'];						
+								$this->shop->view['pflicht']['custom'][$c_id]['show'] = $c['show'];
 								$this->shop->view['pflicht']['custom'][$c_id]['auswahl'] = $c['auswahl'];
-								
+
 								$this->shop->addTranslationString('customervars_'.$c_id.'_auswahl', $c['auswahl']);
 								*/
 							}
-														
+
 						}
-						
+
 					}
 					else
 					{
-						
+
 						if ($k == 'anrede_auswahl')
 						{
-							
+
 							$this->shop->addTranslationString('anrede_auswahl', $v);
-							
+
 						}
-						
+
 						$this->shop->view['pflicht'][$k] = $v;
-						
+
 					}
-					
-				}
- 
+
+				}
+
 				$this->update_option('wpsg_admin_pflicht', $this->shop->view['pflicht']);
-				
+
 				$this->addBackendMessage(__('Kundenvariablen erfolgreich gespeichert.', 'wpsg'));
-				
-			}
-			
+
+			}
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
 			{
-								
+
 				if (!is_array($this->shop->view['pflicht'])) $this->shop->view['pflicht'] = array();
 				$this->shop->view['pflicht']['custom'][] = array(
@@ -1694,55 +1694,55 @@
 					"auswahl" => ''
 				);
-				
+
 				$this->update_option('wpsg_admin_pflicht', $this->shop->view['pflicht']);
-				
+
 				die($this->shop->render(WPSG_PATH_VIEW.'/admin/kundendaten_tab2.phtml'));
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
 			{
-				
+
 				unset($this->shop->view['pflicht']['custom'][$_REQUEST['kv_index']]);
 				$this->update_option('wpsg_admin_pflicht', $this->shop->view['pflicht']);
-								
+
 				die("1");
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'inlinedit')
 			{
-				
+
 				if ($_REQUEST['field'] == 'name')
 				{
-					
-					$this->shop->view['pflicht']['custom'][$_REQUEST['field_id']]['name'] = $_REQUEST['value']; 
-						
+
+					$this->shop->view['pflicht']['custom'][$_REQUEST['field_id']]['name'] = $_REQUEST['value'];
+
 				}
 				else if ($_REQUEST['field'] == 'show')
 				{
-						
+
 					$this->shop->view['pflicht']['custom'][$_REQUEST['field_id']]['show'] = $_REQUEST['value'];
-				
+
 				}
 				else if ($_REQUEST['field'] == 'typ')
 				{
-				
+
 					$this->shop->view['pflicht']['custom'][$_REQUEST['field_id']]['typ'] = $_REQUEST['value'];
-				
+
 				}
 				else if ($_REQUEST['field'] == 'auswahl')
 				{
-				
+
 					$this->shop->view['pflicht']['custom'][$_REQUEST['field_id']]['auswahl'] = $_REQUEST['value'];
-				
-				}
-				
+
+				}
+
 				$this->update_option('wpsg_admin_pflicht', $this->shop->view['pflicht']);
-				
-				die(stripslashes($_REQUEST['value'])); 
-				
-			}
-						
+
+				die(stripslashes($_REQUEST['value']));
+
+			}
+
 		} // public function kundendatenAction()
-		
+
 		/**
 		 * Konfiguration der E-Mail Einstellungen
@@ -1750,17 +1750,17 @@
 		public function emailconfAction()
 		{
-			
-			if (isset($_REQUEST['submit'])) 
-			{
-							
+
+			if (isset($_REQUEST['submit']))
+			{
+
 				$this->update_option('wpsg_htmlmail', $_REQUEST['wpsg_htmlmail']);
-				
+
 				wpsg_saveEMailConfig("global"); // Global
 				wpsg_saveEMailConfig('adminmail'); // Admin Mail
 				wpsg_saveEMailConfig('kundenmail'); // Kunden Mail
 				wpsg_saveEMailConfig('status'); // Mail StatusÃ€nderung
-				
+
 				$this->shop->callMods('admin_emailconf_save');
-				
+
 				$this->shop->addBackendMessage(__('E-Mail Konfiguration erfolgreich gespeichert.', 'wpsg'));
 
@@ -1768,12 +1768,12 @@
 
 			}
-			
+
 			if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'del_attach_file')
 			{
 				$this->update_option('wpsg_kundenmail_attachfile', '');
 			}
-				
+
 		} // public function emailconfAction()
-		
+
 		/**
 		 * Wird aufgerufen wenn die Seiten verwaltet werden sollen
@@ -1783,19 +1783,19 @@
 
 			$pages = get_pages();
-			
+
 			$arPages = array(
 				'0' => __('Keine Zuordnung', 'wpsg'),
 				'-1' => __('Neu anlegen und zuordnen', 'wpsg')
 			);
-			
+
 			foreach ($pages as $k => $v)
 			{
 				$arPages[$v->ID] = $v->post_title.' (ID:'.$v->ID.')';
 			}
-			
+
 			$this->shop->view['pages'] = $arPages;
-			
+
 		} // public function seitenAction()
-		 
+
 		/**
 		 * Modulverwaltung
@@ -1803,14 +1803,14 @@
 		public function moduleAction()
 		{
-			
+
 			if (isset($_REQUEST['noheader']) && $_REQUEST['noheader'] == '1' && !isset($_REQUEST['submit']))
 			{
-				
+
 				// Ajax Anfrage eines Moduls
 				$this->shop->callMod($_REQUEST['modul'], 'be_ajax');
 				die();
-				
-			}
-									
+
+			}
+
 			$this->shop->view = array(
 				'actionName' => 'module',
@@ -1818,40 +1818,40 @@
 				'groups' => array()
 			);
-			
+
 			$this->shop->view['global'] = false;
 			if ($this->shop->isMultiBlog() && $this->shop->get_option('wpsg_multiblog_standalone', true) != '1') $this->shop->view['global'] = true;
-									
+
 			$this->shop->loadModule(true);
-			
+
 			if (isset($_REQUEST['submit'])) { $this->submitAction(); }
-			
+
 			foreach ($this->shop->arAllModule as $mod_key => $m)
 			{
-				
+
 				if ($mod_key == 'wpsg_mod_core') continue;
-				
+
 				$group = $m->group;
-				
+
 				if (trim($group) == '') $group = __('Sonstiges', 'wpsg');
-				
+
 				$this->shop->view['groups'][$group][$mod_key] = $m;
-				
-			}
-			
+
+			}
+
 			// Gruppen sortieren
-			ksort($this->shop->view['groups']); 
-			
+			ksort($this->shop->view['groups']);
+
 			// Module in den Gruppen sortieren
 			foreach ($this->shop->view['groups'] as $k => $g)
 			{
-				
+
 				uasort($this->shop->view['groups'][$k], array($this->shop, 'cmp_mods_name'));
-				
-			}
-						
+
+			}
+
 			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');
-			
+
 		} // public function moduleAction()
-			
+
 		/**
 		 * Hilfe Seite
@@ -1859,14 +1859,14 @@
 		public function hilfeAction()
 		{
-			
+
 			$this->shop->view = array(
 				'actionName' => 'hilfe',
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/hilfe.phtml'
 			);
-			
-			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');			
-			
+
+			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');
+
 		} // public function hilfeAction()
-		
+
 		/**
 		 * Behandelt das Speichern der Widerrufsbelehrung
@@ -1874,105 +1874,105 @@
 		public function widerrufsbelehrungAction()
 		{
-			
+
 			if (isset($_REQUEST['submit']))
 			{
-				
+
 				$this->shop->update_option('wpsg_ps_mailwiderruf', $_REQUEST['wpsg_ps_mailwiderruf']);
 				$this->shop->addTranslationString('wpsg_ps_mailwiderruf', $_REQUEST['wpsg_ps_mailwiderruf']);
-								
+
 				if (file_exists($_FILES['wpsg_widerrufsformular']['tmp_name']))
 				{
-					
+
 					if (!file_exists(WPSG_PATH_UPLOADS.'wpsg_revocation/')) mkdir(WPSG_PATH_UPLOADS.'wpsg_revocation/', 0775, true);
-				
+
 					$this->clearRevocationForm();
-					
+
 					move_uploaded_file($_FILES['wpsg_widerrufsformular']['tmp_name'], WPSG_PATH_UPLOADS.'wpsg_revocation/'.$_FILES['wpsg_widerrufsformular']['name']);
 					$this->addBackendMessage(__('Widerrufsformular erfolgreich hochgeladen.', 'wpsg'));
-				
+
 					$this->shop->update_option('wpsg_revocationform', $_FILES['wpsg_widerrufsformular']['name']);
-					
-				}
-				
+
+				}
+
 				$this->shop->update_option('wpsg_widerrufsformular_kundenmail', $_REQUEST['wpsg_widerrufsformular_kundenmail']);
-				
+
 				if ($this->shop->hasMod('wpsg_mod_rechnungen'))
 				{
-					
+
 					$this->shop->update_option('wpsg_widerrufsformular_invoice', $_REQUEST['wpsg_widerrufsformular_invoice']);
-					
-				}
-				
+
+				}
+
 				if ($this->shop->hasMod('wpsg_mod_auftragsbestaetigung'))
 				{
-					
+
 					$this->shop->update_option('wpsg_widerrufsformular_orderconfirm', $_REQUEST['wpsg_widerrufsformular_orderconfirm']);
-					
-				}
-								
+
+				}
+
 				$this->addBackendMessage(__('Widerruf erfolgreich gespeichert.', 'wpsg'));
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=widerrufsbelehrung');
-				
-			}
-			
+
+			}
+
 			if (wpsg_isSizedString($_REQUEST['do']) && $_REQUEST['do'] == 'generateWiderrufsformular')
 			{
 
 				if (!file_exists(WPSG_PATH_UPLOADS.'wpsg_revocation/')) mkdir(WPSG_PATH_UPLOADS.'wpsg_revocation/', 0775, true);
-				
+
 				$this->clearRevocationForm();
-				
-				$this->shop->view['filename'] = WPSG_PATH_UPLOADS.'wpsg_revocation/widerrufsformular.pdf';				
+
+				$this->shop->view['filename'] = WPSG_PATH_UPLOADS.'wpsg_revocation/widerrufsformular.pdf';
 				$this->shop->render(WPSG_PATH_VIEW.'/admin/musterwiderruf.pdf.phtml');
-				
+
 				$this->shop->update_option('wpsg_revocationform', 'widerrufsformular.pdf');
-				
-				$this->addBackendMessage(__('Widerrufsformular erfolgreich generiert.', 'wpsg'));				
+
+				$this->addBackendMessage(__('Widerrufsformular erfolgreich generiert.', 'wpsg'));
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=widerrufsbelehrung');
-				
-			}
-			else if (wpsg_isSizedString($_REQUEST['do']) && $_REQUEST['do'] == 'removeWiderrufsformular')				
-			{
-				
+
+			}
+			else if (wpsg_isSizedString($_REQUEST['do']) && $_REQUEST['do'] == 'removeWiderrufsformular')
+			{
+
 				$bOK = unlink(WPSG_PATH_UPLOADS.'wpsg_revocation/'.$this->shop->get_option('wpsg_revocationform'));
-				
+
 				if ($bOK === true)
 				{
-				
+
 					$this->shop->update_option('wpsg_revocationform', false);
-				
+
 					$this->addBackendMessage(__('Widerrufsformular erfolgreich gelÃ¶scht.', 'wpsg'));
-										
+
 				}
 				else
 				{
-					
-					$this->addBackendError(__('Widerrufsformular konnte nicht gelÃ¶scht werden.', 'wpsg')); 
-			
-				}
-				
+
+					$this->addBackendError(__('Widerrufsformular konnte nicht gelÃ¶scht werden.', 'wpsg'));
+
+				}
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=widerrufsbelehrung');
-				
-			}
-									
+
+			}
+
 			$revocationform = WPSG_PATH_UPLOADS.'wpsg_revocation/'.$this->shop->get_option('wpsg_revocationform');
-			
+
 			if (file_exists($revocationform) && is_file($revocationform))
 			{
-				
+
 				$this->shop->view['revocationform'] = basename($revocationform);
-				
-			}
-			
+
+			}
+
 		} // public function widerrufsbelehrungAction()
-		
+
 		private function clearRevocationForm()
 		{
-			
+
 			$bOK = @unlink(WPSG_PATH_UPLOADS.'wpsg_revocation/'.$this->shop->get_option('wpsg_revocationform'));
 			$this->shop->update_option('wpsg_revocationform', false);
-			
+
 		} // private function clearRevocationForm()
-		
+
 		/**
 		 * Zeigt die News im Backend an
@@ -1980,36 +1980,36 @@
 		public function newsAction()
 		{
-			
+
 			if (wpsg_isSizedInt($_REQUEST['reload']))
 			{
-				
+
 				wpsg_news::getLatestNewsFromRSS();
-				 
-				$this->shop->addBackendMessage(__('Refresh der News erfolgreich durchgefÃŒhrt.', 'wpsg'));								
+
+				$this->shop->addBackendMessage(__('Refresh der News erfolgreich durchgefÃŒhrt.', 'wpsg'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=news');
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['read']))
 			{
-				
+
 				$news = wpsg_news::getNewsById(rawurldecode($_REQUEST['read']));
-				
+
 				if ($news === false)
 				{
-					
+
 					$this->shop->addBackendError(__('News wurde nicht gefunden,', 'wpsg'));
 					$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=news');
-					
+
 				}
 				else
 				{
-				
+
 					wpsg_news::markRead($_REQUEST['read']);
 					$this->shop->redirect($news['url']);
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			$this->shop->view = array(
 				'actionName' => 'news',
@@ -2017,9 +2017,9 @@
 				'news' => wpsg_news::getLatestNews()
 			);
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');
-			
+
 		} // public function newsAction()
-		
+
 		/**
 		 * Zeigt Informationen zu dem Shop und aktivierten Modulen an
@@ -2027,25 +2027,25 @@
 		public function ueberAction()
 		{
-            
+
             if (wpsg_isSizedString($_REQUEST['subaction'], 'clearSysLog'))
             {
-                
+
                 @unlink($GLOBALS['wpsg_sc']->getStorageRoot().'exception.log');
-                
+
                 $this->addBackendMessage(__('Fehlerprotokoll gelÃ¶scht.', 'wpsg'));
-                
+
                 $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemlog');
-                
+
             }
-			
+
 			$this->shop->view = array(
 				'actionName' => 'ueber',
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/ueber.phtml'
 			);
-				
+
 			$this->shop->render(WPSG_PATH_VIEW.'/admin/index.phtml');
-			
+
 		} // public function ueberAction()
-		
+
 		/**
 		 * Erweiterte Einstellungen
@@ -2053,15 +2053,15 @@
 		public function extendedAction()
 		{
-			
+
 			$this->shop->view['arGeoMode'] = array('0' => __('Immer anzeigen', 'wpsg'));
-			
+
 			if (isset($_SERVER['GEOIP_COUNTRY_CODE'])) $this->shop->view['arGeoMode'][1] = __('Anhand des Apache Moduls mod_geoip', 'wpsg');
 			if (function_exists("geoip_country_code_by_name")) $this->shop->view['arGeoMode'][2] = __('Anhand der PECL Erweiterung php_geoip', 'wpsg');
-									
+
 			$this->shop->view['arGeoMode'][3] = __('Anhand der Browsersprache', 'wpsg');
 			$this->shop->view['arGeoMode'][4] = __('nicht anzeigen', 'wpsg');
-			
+
 		} // public function extendedAction()
-		
+
 		/**
 		 * Wird beim absenden des Formulars aufgerufen
@@ -2069,13 +2069,13 @@
 		public function submitAction()
 		{
-			
+
 			global $wpdb;
-			
+
 			if (@$_REQUEST['subaction'] == 'konfiguration')
 			{
-				
+
 				$this->update_option('wpsg_currency', $_REQUEST['wpsg_currency']);
 				$this->update_option('wpsg_showincompleteorder', $_REQUEST['wpsg_showincompleteorder']);
-				$this->update_option('wpsg_produkte_perpage', $_REQUEST['wpsg_produkte_perpage']);				
+				$this->update_option('wpsg_produkte_perpage', $_REQUEST['wpsg_produkte_perpage']);
 				$this->update_option('wpsg_emptyorder_clear', $_REQUEST['wpsg_emptyorder_clear']);
 				$this->update_option('wpsg_order_perpage', $_REQUEST['wpsg_order_perpage']);
@@ -2085,21 +2085,21 @@
 				$this->update_option('wpsg_format_knr', $_REQUEST['wpsg_format_knr']);
 				$this->update_option('wpsg_order_knr', $_REQUEST['wpsg_order_knr']);
-				$this->update_option('wpsg_customer_start', $_REQUEST['wpsg_customer_start']);			
+				$this->update_option('wpsg_customer_start', $_REQUEST['wpsg_customer_start']);
 				$this->update_option('wpsg_format_onr', $_REQUEST['wpsg_format_onr']);
 				$this->update_option('wpsg_order_start', $_REQUEST['wpsg_order_start']);
-				
+
 				if (wpsg_isSizedString($_REQUEST['wpsg_backend_language']))
 				{
 					$this->update_option('wpsg_backend_language', $_REQUEST['wpsg_backend_language']);
 				}
-				
+
 				$this->addBackendMessage(__('Einstellungen gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin');
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'extended')
 			{
-				
+
 				$this->update_option('wpsg_salt', $_REQUEST['wpsg_salt']);
 				$this->update_option('wpsg_options_nl2br', $_REQUEST['wpsg_options_nl2br']);
@@ -2107,7 +2107,7 @@
                 $this->update_option('wpsg_displayTemplates', $_REQUEST['wpsg_displayTemplates']);
                 $this->update_option('wpsg_displayTemplatesLog', $_REQUEST['wpsg_displayTemplatesLog']);
-				
+
 				if ($this->shop->hasMod('wpsg_mod_core')) $this->update_option('wpsg_debugURL', $_REQUEST['wpsg_debugURL']);
-				
+
 				$this->update_option('wpsg_referer_requesturi', $_REQUEST['wpsg_referer_requesturi']);
 				$this->update_option('wpsg_ignoreuserview', $_REQUEST['wpsg_ignoreuserview']);
@@ -2124,41 +2124,41 @@
 				$this->update_option('wpsg_autolineending', $_REQUEST['wpsg_autolineending']);
 				$this->update_option('wpsg_geo_determination', $_REQUEST['wpsg_geo_determination']);
-				
+
 				$this->addBackendMessage(__('Einstellungen gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=extended');
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'presentation')
 			{
-				
+
 				$this->update_option('wpsg_showMwstAlways', $_REQUEST['wpsg_showMwstAlways']);
 				$this->update_option('wpsg_form_validation', $_REQUEST['wpsg_form_validation']);
 				$this->update_option('wpsg_showArticelnumber', $_REQUEST['wpsg_showArticelnumber']);
 				$this->update_option('wpsg_hideBasketCountrySelect', $_REQUEST['wpsg_hideBasketCountrySelect']);
-				
-				$this->shop->callMods('admin_presentation_submit');				
-				
+
+				$this->shop->callMods('admin_presentation_submit');
+
 				$this->addBackendMessage(__('Einstellungen gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=presentation');
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'path')
 			{
-				
+
 				$this->shop->update_option('wpsg_path_upload_multiblog', $_REQUEST['wpsg_path_upload_multiblog'], true);
-				
+
 				$this->addBackendMessage(__('Einstellungen gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=path');
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'loadsavesettings')
 			{
-				
+
 				if (isset($_REQUEST['wpsg_do']) && $_REQUEST['wpsg_do'] == 'downloadsettings')
 				{
-					
+
 					$arSettings = $this->db->fetchAssoc("
 						SELECT
@@ -2168,23 +2168,23 @@
 						WHERE
 							(
-								`option_name` LIKE 'wpsg_%' 
-							) 
+								`option_name` LIKE 'wpsg_%'
+							)
 							AND
 							(
 								`option_name` != 'wpsg_installed' AND
-								`option_name` != 'wpsg_modul' 							
+								`option_name` != 'wpsg_modul'
 							)
-					"); 
-					
+					");
+
 					$doc = new DOMDocument('1.0');
 					$doc->formatOutput = true;
 					$doc->encoding = "utf-8";
-					
-					$node = $doc->createElement("wpsg");  
-					
-					$settings = $doc->createElement("settings");				
+
+					$node = $doc->createElement("wpsg");
+
+					$settings = $doc->createElement("settings");
 					foreach ($arSettings as $s)
 					{
-						
+
 						$setting = $doc->createElement("option");
 						wpsg_addAttributs($doc, $setting, array(
@@ -2196,71 +2196,71 @@
 						));
 						$settings->appendChild($setting);
-						
+
 					}
-					
+
 					$node->appendChild($settings);
 					$doc->appendChild($node);
-					
+
 					header('Cache-Control: private');
 					header('Content-Type: application/download; charset=utf-8');
-					header('Content-Disposition: filename=wpsg_settings_'.date('dmYHi').'.xml');	
+					header('Content-Disposition: filename=wpsg_settings_'.date('dmYHi').'.xml');
 					header('Pragma: public');
-					
+
 					session_cache_limiter('nocache');
-					
+
 					die($doc->saveXML());
-				
+
 				}
 
 				if (file_exists($_FILES['wpsg_settings']['tmp_name']))
 				{
-					
-					$xml = simplexml_load_file($_FILES['wpsg_settings']['tmp_name']);			        	
-		        	
+
+					$xml = simplexml_load_file($_FILES['wpsg_settings']['tmp_name']);
+
 					if ($xml === false)
 					{
-						
+
 						$this->shop->addBackendError(__('Keine gÃŒltige XML Einstellungsdatei angegeben!', 'wpsg'));
-						
+
 					}
 					else
 					{
-					
-						$path ="/wpsg/settings/option";			        	
+
+						$path ="/wpsg/settings/option";
 			        	$res = $xml->xpath($path);
-			        	
+
 			        	foreach ($res as $k => $v)
 			        	{
-			        		
+
 			        		$a = $v->attributes();
-			        		
+
 			        		$bExists = $this->db->fetchOne("SELECT `option_id` FROM `".$wpdb->prefix."options` WHERE `option_name` = '".wpsg_q(strval($a->option_name))."' ");
-			        		
+
 			        		if ($bExists > 0)
 			        		{
-			        		 
+
 			        			$this->db->UpdateQuery($wpdb->prefix."options", array(
 			        				"option_value" => wpsg_q(strval($a->option_value))
-			        			), "`option_name` = '".wpsg_q(strval($a->option_name))."'"); 
-			        			
+			        			), "`option_name` = '".wpsg_q(strval($a->option_name))."'");
+
 			        		}
 			        		else
 			        		{
-			        	 
+
 			        			$this->db->ImportQuery($wpdb->prefix."options", array(
-			        				"blog_id" => wpsg_q(strval($a->blog_id)),			        				
+			        				"blog_id" => wpsg_q(strval($a->blog_id)),
 			        				"option_name" => wpsg_q(strval($a->option_name)),
 			        				"option_value" => wpsg_q(strval($a->option_value)),
-			        				"autoload" => wpsg_q(strval($a->autoload))			        				
+			        				"autoload" => wpsg_q(strval($a->autoload))
 			        			), true);
-			        			
-			        		} 
-			        		
+
+			        		}
+
 			        	}
-			        	
+
 			        	$this->shop->addBackendMessage(__('Einstellungen wurden erfolgreich importiert.', 'wpsg'));
-			        	
+
 					}
-					
+
 				}
 				else
@@ -2268,13 +2268,13 @@
 
 					$this->shop->addBackendError(__('Bitte eine Einstellungsdatei angeben!', 'wpsg'));
-					
-				}	
+
+				}
 
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=loadsavesettings');
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'includes')
-			{ 
-				
+			{
+
 				$this->update_option('wpsg_load_css', $_REQUEST['wpsg_load_css']);
 				$this->update_option('wpsg_load_jquery', $_REQUEST['wpsg_load_jquery']);
@@ -2283,162 +2283,163 @@
 				$this->update_option('wpsg_load_validierung_js', $_REQUEST['wpsg_load_validierung_js']);
 				$this->update_option('wpsg_load_validierung_css', $_REQUEST['wpsg_load_validierung_css']);
-				
+				$this->update_option('wpsg_load_bootstrap_glyphfont_css', $_REQUEST['wpsg_load_bootstrap_glyphfont_css']);
+
 				$this->shop->callMods('admin_includes_save');
-				
+
 				$this->addBackendMessage(__('Einstellungen gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=includes');
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'blognetzwerk')
 			{
-				
+
 				$this->update_option('wpsg_multiblog_standalone', $_REQUEST['wpsg_multiblog_standalone'], true);
 				$this->update_option('wpsg_multiblog_sessionPath', $_REQUEST['wpsg_multiblog_sessionPath'], true);
-								
+
 				$this->addBackendMessage(__('Einstellungen gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=blognetzwerk');
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'kalkulation')
 			{
-				
+
 				$this->update_option('wpsg_kleinunternehmer', $_REQUEST['wpsg_kleinunternehmer']);
 				$this->update_option('wpsg_kleinunternehmer_text', $_REQUEST['wpsg_kleinunternehmer_text']);
 				$this->update_option('wpsg_preisangaben', $_REQUEST['wpsg_preisangaben']);
-				$this->update_option('wpsg_preisangaben_frontend', $_REQUEST['wpsg_preisangaben_frontend']);				
+				$this->update_option('wpsg_preisangaben_frontend', $_REQUEST['wpsg_preisangaben_frontend']);
 				$this->update_option('wpsg_hideemptyshipping', $_REQUEST['wpsg_hideemptyshipping']);
 				$this->update_option('wpsg_hideemptypayment', $_REQUEST['wpsg_hideemptypayment']);
-								
+
 				$this->addBackendMessage(__('Einstellung gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction='.$_REQUEST['subaction']);
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'access')
 			{
-				
+
 				$this->addBackendMessage(__('Berechtigungen gespeichert.', 'wpsg'));
-				
+
 				if (wpsg_isSizedArray($_REQUEST['wpsg_cap']))
 				{
-					
+
 					foreach ($_REQUEST['wpsg_cap'] as $role_name => $cap)
 					{
-						 
+
 						$role_object = get_role($role_name);
-												
+
 						foreach ($cap as $cap_key => $cap_value)
 						{
-							
+
 							if ($cap_value == '1')
 							{
-								
+
 								$role_object->add_cap($cap_key);
-								
+
 							}
 							else
 							{
-								
+
 								$role_object->remove_cap($cap_key);
-								
+
 							}
-							
+
 						}
-						
+
 					}
-					
-				}
-				
+
+				}
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction='.$_REQUEST['subaction']);
-				
+
 			}
 			else if (@$_REQUEST['subaction'] == 'seiten')
 			{
-				
+
 				// Seiten speichern
-				$this->createPage(__('Warenkorb', 'wpsg'), 'wpsg_page_basket', $_REQUEST['wpsg_page_basket']);				
+				$this->createPage(__('Warenkorb', 'wpsg'), 'wpsg_page_basket', $_REQUEST['wpsg_page_basket']);
 				$this->createPage(__('Versandkosten', 'wpsg'), 'wpsg_page_versand', $_REQUEST['wpsg_page_versand']);
 				$this->createPage(__('Produktdetail', 'wpsg'), 'wpsg_page_product', $_REQUEST['wpsg_page_product']);
 				$this->createPage(__('AGB', 'wpsg'), 'wpsg_page_agb', $_REQUEST['wpsg_page_agb']);
 				$this->createPage(__('Datenschutz', 'wpsg'), 'wpsg_page_datenschutz', $_REQUEST['wpsg_page_datenschutz']);
-				$this->createPage(__('Widerrufsbelehrung', 'wpsg'), 'wpsg_page_widerrufsbelehrung', $_REQUEST['wpsg_page_widerrufsbelehrung']);				
+				$this->createPage(__('Widerrufsbelehrung', 'wpsg'), 'wpsg_page_widerrufsbelehrung', $_REQUEST['wpsg_page_widerrufsbelehrung']);
 				$this->update_option('wpsg_page_onlinedisputeresolution', $_REQUEST['wpsg_page_onlinedisputeresolution']);
 				$this->createPage(__('Impressum', 'wpsg'), 'wpsg_page_impressum', $_REQUEST['wpsg_page_impressum']);
-				
+
 				$this->addBackendMessage(__('Seiteneinstellungen bearbeitet.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction='.$_REQUEST['subaction']);
-				
+
 			}
 			else if (@$_REQUEST['action'] == 'module')
 			{
-			 
+
 				$global = false;
 				if ($this->shop->isMultiBlog() && $this->shop->get_option('wpsg_multiblog_standalone', true) != '1') $global = true;
-				
+
 				if ($this->get_option($_REQUEST['modul'], $global) > 0 && $_REQUEST['aktiv'] == '1' && array_key_exists($_REQUEST['modul'], $this->shop->arModule))
 				{
-					
+
 					$this->shop->arModule[$_REQUEST['modul']]->settings_save();
-					
+
 					$this->shop->addBackendMessage(__('Moduleinstellungen gespeichert', 'wpsg'));
-					
-				}
-				
-				
+
+				}
+
+
 				// Modul aktivieren wenn noch nicht aktiviert
-				if ($_REQUEST['aktiv'] == '1' && $this->get_option($_REQUEST['modul'], $global) == false)				
-				{	
-					
+				if ($_REQUEST['aktiv'] == '1' && $this->get_option($_REQUEST['modul'], $global) == false)
+				{
+
 					$init = base64_decode('aW5zdGFsbEZpcnN0'); //installFirst;
-					
+
 					$this->update_option($_REQUEST['modul'], time(), $global);
 					$this->shop->arAllModule[$_REQUEST['modul']]->$init();
-					$this->shop->arAllModule[$_REQUEST['modul']]->install();	
-									
+					$this->shop->arAllModule[$_REQUEST['modul']]->install();
+
 				}
 				else if ($_REQUEST['aktiv'] == '0')
 				{
-					
+
 					$this->update_option($_REQUEST['modul'], false, $global);
-					
-				}
- 
+
+				}
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul='.$_REQUEST['modul']);
-				
-			}
-			else 
-			{
-				
+
+			}
+			else
+			{
+
 				if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'update')
 				{
-					
+
 					wpsg_install();
 					$this->addBackendMessage(__('Datenbank erfolgreich abgeglichen!', 'wpsg'));
-					
+
 					$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=allgemein');
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 		} // public function submitAction()
-		
+
 		/**
 		 * Soll die Datenbank auf den neuesten Stand bringen
 		 */
 		public function updateAction()
-		{ 
-			
+		{
+
 			include WPSG_PATH.'/lib/install.php';
-						
+
 			$this->shop->callMods('install');
-						
+
 			$this->addBackendMessage(__('Datenbank aktualisiert', 'wpsg'));
-			
+
 		} // public function updateAction()
-		
+
 		/**
 		 * Zeigt die Hilfe fÃŒr den Tooltip an
@@ -2446,17 +2447,17 @@
 		private function loadHelpAction()
 		{
-			
+
 			global $q_config;
-			
-			$page = $_REQUEST['field']; 
-			
+
+			$page = $_REQUEST['field'];
+
 			$xml_content = $this->shop->get_url_content('http://trac.wpshopgermany.de/wiki/'.$page);
 
 			if ($xml_content !== false && strlen(trim($xml_content)) > 0)
 			{
-			
+
 				$doc = new DOMDocument();
 				$doc->loadHTML($xml_content);
-				
+
 				$xpath = new DOMXPath($doc);
 				$entries = $xpath->query('//div[@id="wikipage"]');
@@ -2465,17 +2466,17 @@
 
 				foreach ($entries as $entry) {
-	 
+
 					$strReturn = $entry->ownerDocument->saveXml($entry);
-					 
-				}
-				 
+
+				}
+
 				$strReturn = preg_replace('/\"\//', '"http://trac.wpshopgermany.de/', $strReturn);
-				
+
 				$arLocales = $arLocales = $q_config['locale'];
 				if (wpsg_isSizedArray($arLocales) && wpsg_isSizedString(get_locale()))
 				{
-				
+
 					$iso_lang = array_search(get_locale(), $arLocales);
-					
+
 					if (wpsg_isSizedString($iso_lang) && preg_match('/&lt;localization_'.$iso_lang.'&gt;(.*)&lt;\/localization_'.$iso_lang.'&gt;/is', $strReturn))
 					{
@@ -2483,13 +2484,13 @@
 						$strReturn = preg_replace('/(.*)&lt;localization_'.$iso_lang.'&gt;/is', '', $strReturn);
 						$strReturn = preg_replace('/&lt;\/localization_'.$iso_lang.'&gt;(.*)/is', '', $strReturn);
-						
+
 					}
-				
-					
-				}
-				
+
+
+				}
+
 				// Andere Ãbersetzungen entfernen
 				$strReturn = preg_replace('/&lt;localization_(.*)&gt;(.*)&lt;\/localization_(.*)&gt;/is', '', $strReturn);
-				 
+
 				//$strReturn .= '<a style="color:#FFFFFF; text-decoration:underline;" target="_blank" href="http://trac.wpshopgermany.de/wiki/'.$page.'">'.__('zur Hilfe Seite ...', 'wpsg').'</a><br /><br />';
 
@@ -2499,11 +2500,11 @@
 
 				$strReturn = __('Noch kein Hilfetext hinterlegt. Bitte versuchen Sie es spÃ€ter noch einmal.<br />Hilfe finden sie auch unter <a href="http://forum.maennchen1.de">http://forum.maennchen1.de</a>', 'wpsg');
-				
-			}
-			 
+
+			}
+
 			die('<div class="wpsg-help-content">'.$strReturn.'</div>');
-			
+
 		} // private function loadHelpAction()
-		
+
 		/**
 		 * Deaktiviert alle Plugins auÃer wpShopGermany und merkt sich die aktivierten Plugins
@@ -2511,27 +2512,27 @@
 		public function plugintest_disableAction()
 		{
-			
+
 			// Plugins vor dem Test
 			$arPlugins = $this->shop->get_option('active_plugins');
-									
+
 			// Plugins vor dem Test speichern
 			$this->shop->update_option('wpsg_plugintest_active_plugins', $arPlugins);
-			
+
 			// Alle Plugins auÃer wpShopGermany entfernen
 			foreach ($arPlugins as $k => $p)
 			{
-				
+
 				if (!preg_match('/(.*)wpshopgermany\.php(.*)/', $p)) unset($arPlugins[$k]);
-				
-			}
-		 
+
+			}
+
 			// ZurÃŒckspeichern
 			$this->shop->update_option('active_plugins', $arPlugins);
-			
+
 			$this->shop->addBackendMessage(__('Es wurden alle Plugins bis auf wpShopGermany deaktiviert.', 'wpsg'));
 			$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber');
-						
+
 		} // public function plugintest_disableAction()
-		
+
 		/**
 		 * Stellt die vorher mittels plugintest_disableAction deaktivierten Module wieder her
@@ -2539,29 +2540,29 @@
 		public function plugintest_restoreAction()
 		{
-			
+
 			$arPlugins_restore = $this->shop->get_option('wpsg_plugintest_active_plugins');
-			
+
 			if (!wpsg_isSizedArray($arPlugins_restore))
 			{
-				
+
 				$this->shop->addBackendError(__('Plugins konnten nicht wieder hergestellt werden, da nicht gespeichert wurde welche Plugins aktiv waren.', 'wpsg'));
-				
+
 			}
 			else
 			{
-								
+
 				// Alte Plugins wieder herstellen
 				$this->shop->update_option('active_plugins', $arPlugins_restore);
-				
+
 				$this->shop->update_option('wpsg_plugintest_active_plugins', false);
-				
+
 				$this->shop->addBackendMessage(__('Aktivierte Plugins wurden erfolgreich wieder hergesetellt.', 'wpsg'));
-				
-			}
-			
+
+			}
+
 			$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber');
-			
+
 		} // public function plugintest_restoreAction()
-		
+
 		/**
 		 * Installiert ein Modul
@@ -2569,14 +2570,14 @@
 		public function installModul($modul_key)
 		{
-			
+
 			$this->shop->callMod('wpsg_mod_core', 'installModul', array($modul_key));
-			
+
 		} // private function installModul($modul_key)
- 
+
 		/**
 		 * Nach dem Update auf Version3 ist es durch den Export in die XML Datei zu einer serialisierung des schon serialisierten Strings gekommen
 		 * Diese Funktion korrigiert dies
-		 * Es betrifft folgende SchlÃŒssel: 
-		 * 
+		 * Es betrifft folgende SchlÃŒssel:
+		 *
 		 * wpsg_admin_pflicht
 		 * wpsg_mod_discount_data
@@ -2585,33 +2586,33 @@
 		 * wpsg_mod_rechnungen_texte
 		 * wpsg_rechnungen_footer
-		 * 
+		 *
 		 * Aufgerufen wird sie im Backend bei den allgemeinen Einstellungen
 		 */
 		private function CheckAndCorrectSerOption()
 		{
-			
+
 			$arOptions = array('wpsg_admin_pflicht', 'wpsg_mod_discount_data', 'wpsg_mod_downloadplus_text', 'wpsg_mod_pdfdownload_text', 'wpsg_mod_rechnungen_texte', 'wpsg_rechnungen_footer');
-			
+
 			foreach ($arOptions as $o)
 			{
-				
+
 				$value = $this->shop->get_option($o);
-				
+
 				if ($value === false) continue; // Wert ist ÃŒberhaupt nicht gesetzt, eventuell weil Modul nicht aktiviert
-				
+
 				if (!is_array($value) && (is_string($value) && preg_match('/^a\:\d+/', $value)))
 				{
-					
+
 					$korrektur_value = @unserialize($value);
-					
+
 					if (is_array($korrektur_value)) $this->shop->update_option($o, $korrektur_value);
-					
-					 
-				}
-				 
-			}
-			
+
+
+				}
+
+			}
+
 		} // public function CheckAndCorrectSerOption()
-		
+
 	} // class wpsg_AdminController extends wpsg_SystemController
 
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 6337)
+++ /controller/wpsg_ShopController.class.php	(revision 6338)
@@ -1,43 +1,43 @@
-<?php 
+<?php
 
 	/**
 	 * Zentrale Klasse des wpShopGermanys
 	 */
-	class wpsg_ShopController extends wpsg_SystemController 
+	class wpsg_ShopController extends wpsg_SystemController
 	{
-		
+
 		/**  Array mit allen Installierten Modulen */
-		var $arModule;	
+		var $arModule;
 
 		/** Array mit den Lizenzinformationen */
 		var $arLizenz = false;
-		 		
+
 		/** BasketController */
 		var $basketController;
-		
+
 		/** Der Warenkorb */
 		var $basket;
-		
+
 		/** Alle Versandkosten der aktivierten Module */
 		var $arShipping;
-		
+
 		/** Versandarten wurden schon zusammengefÃŒhrt */
 		var $bShippingMerged = false;
-		
+
 		/** Alle Zahlungsarten der aktivierten Module */
 		var $arPayment;
-		
+
 		/** Alle BestellzustÃ€nde */
 		var $arStatus;
-		 		
+
 		/** Tabellenprefix */
 		var $prefix;
-		
+
 		/** Cache Klasse */
 		var $cache;
-				
+
 		/** Bindet im wp_foot den Layer ein, sollte es eine Shop Ausgabe erfordern */
 		var $showEULayer = false;
-		
+
 		/** ErmÃ¶glicht es in einer anderen Sprache als die aktuelle Locale zu arbeiten */
 		var $force_locale = false;
@@ -45,18 +45,18 @@
 		/** Gibt an, ob das Produkt ÃŒber einen Shortcode gerendert wird (FÃŒr [raw] Funtkion wichtig) */
 		var $bShortcode = false;
-		
+
 		/** Wurden die Versandarten schon zusammengefÃŒgt */
 		var $shipping_alreadymerged = false;
-		
+
 		/** Ob im Warenkorb mit gerundeten Werten weitergerechnet werden soll */
 		var $addRoundedValues = true;
-		
+
 		/** Wird von der the_title auf true gesetzt wenn man auf einer Produktseite ist */
 		var $titleDisplayed = false;
-		
+
 		const CHECK_NOTICE = 1;
 		const CHECK_WARNING = 2;
 		const CHECK_ERROR = 3;
-		
+
 		/** URL Konstanten */
 		const URL_BASKET = 1;
@@ -73,11 +73,11 @@
 		const URL_WIDGET_AJAX = 12;
 		const URL_ORDER = 13;
-		const URL_LOGOUT = 14;  
+		const URL_LOGOUT = 14;
 		const URL_ONLINE_DISPUTE_RESOLUTION = 15;
 		const URL_REQUEST = 16;
 		const URL_LOSTPWD = 17;
 		const URL_PRODUCTDETAIL = 18;
-		
-		/** Status Konstanten */ 
+
+		/** Status Konstanten */
 		const STATUS_EINGEGANGEN = 0;
 		const STATUS_AUFTRAGAKZEPTIERT = 1;
@@ -89,46 +89,46 @@
 		const STATUS_ZUGESTELLT = 300;
 		const STATUS_ZURUECKGEZAHLT = 400;
-		const STATUS_STORNIERT = 500; 
-		
+		const STATUS_STORNIERT = 500;
+
 		/** Seitenkonstanten */
 		const PAGE_BASKET = 1;
-				
+
 		/**
 		 * Constructor
 		 */
-		public function __construct() 
-		{
-						
+		public function __construct()
+		{
+
 			parent::__construct();
-			
+
 			$this->arModule = array();
 			$this->arShipping = array();
 			$this->arPayment = array();
-			
+
 			$this->cache = new wpsg_cache($this->db);
-						
+
 			$this->basketController = new wpsg_BasketController();
-			
+
 			// Lizenz prÃŒfen
 			if ($this->get_option('wpsg_key', true) !== false)
 			{
 
-				if (!class_exists('Crypt_RSA')) 
+				if (!class_exists('Crypt_RSA'))
 				{
 
 					$bOK = @set_include_path(WPSG_PATH.'/lib/phpseclib0.3.0/'.PATH_SEPARATOR.get_include_path());
-										
+
 					require_once(WPSG_PATH.'/lib/phpseclib0.3.0/Crypt/RSA.php');
-					
-				}
-				
+
+				}
+
 				$rsa = new Crypt_RSA();
 				$rsa->loadKey(file_get_contents(WPSG_PATH.'/lib/.htpublic'));
-				
+
 				$arKey = @unserialize($rsa->decrypt(base64_decode($this->get_option('wpsg_key', true))));
-				
+
 				if (is_array($arKey) && $arKey['anwendung'] == 'wpShopGermany')
 				{
-					
+
 					$this->arLizenz = array(
 						'l' => $arKey['l'],
@@ -137,7 +137,7 @@
 						'dev' => (($this->get_option('wpsg_debugURL') == '1')?'1':'0')
 					);
-					
-				}
-								
+
+				}
+
 			}
 
@@ -154,9 +154,9 @@
 				self::STATUS_UNVOLLSTAENDIG => __('UnvollstÃ€ndig', 'wpsg'),
 			);
-						
+
 		} // public function __construct()
-		
-		/**
-		 * Filterung des Seitentitels 
+
+		/**
+		 * Filterung des Seitentitels
 		 */
 		public function the_title($title, $id = null)
@@ -173,9 +173,9 @@
 			// Seitentitel auf Produktseiten nicht anzeigen
 			if ($this->hasMod('wpsg_mod_produktartikel') && get_post_type() === $this->get_option('wpsg_mod_produktartikel_pathkey')) $this->titleDisplayed = true;
-						
+
 			return $title;
-			
+
 		}
-		
+
 		/**
 		 * Wird bei der erstmaligen Installation des Plugins aufgerufen
@@ -185,7 +185,7 @@
 
 			global $wpdb, $current_user;
-			
+
 			$user_id = 0;
-					
+
 			if (function_exists("get_currentuserinfo"))
 			{
@@ -193,13 +193,13 @@
 				$user_id = $current_user->user_ID;
 			}
-			
+
 			if ($user_id == 0 && function_exists("get_current_user_id"))
 			{
 				$user_id = get_current_user_id();
 			}
-									
+
 			// Artikel zum Produkt anlegen
 			$title = __('wpShopGermany DemoProdukt WordPress Artikel', 'wpsg');
-			
+
 			$partikel = $this->db->ImportQuery($wpdb->prefix."posts", array(
 				"post_author" => $user_id,
@@ -214,7 +214,7 @@
 				"post_content" => '',
 				"ping_status" => "closed",
-				"comment_status" => "closed"						
+				"comment_status" => "closed"
 			));
-			
+
 			$product_id = $this->db->ImportQuery(WPSG_TBL_PRODUCTS, array(
 				'cdate' => 'NOW()',
@@ -224,14 +224,14 @@
 				'preis' => '119',
 				'mwst_key' => 'c',
-				'beschreibung' => __('Dies ist der ProdukttextâŠ', 'wpsg')						
+				'beschreibung' => __('Dies ist der ProdukttextâŠ', 'wpsg')
 			));
-			
+
 			$this->db->UpdateQuery($wpdb->prefix."posts", array(
 				"post_name" => wpsg_q($this->clear($title, $partikel)),
 				"post_content" => wpsg_q('[wpshopgermany product="'.$product_id.'"]')
 			), "`ID` = '".wpsg_q($partikel)."'");
-			
+
 			$title = __('wpShopGermany DemoProdukt WordPress Seite', 'wpsg');
-			
+
 			$page = $this->db->ImportQuery($wpdb->prefix."posts", array(
 				"post_author" => $user_id,
@@ -248,51 +248,51 @@
 				"comment_status" => "closed"
 			));
-			
+
 			$this->db->UpdateQuery($wpdb->prefix."posts", array(
 				"post_name" => wpsg_q($this->clear($title, $page)),
 				"post_content" => wpsg_q('[wpshopgermany product="'.$product_id.'"]')
 			), "`ID` = '".wpsg_q($page)."'");
-			 
+
 			if ($this->hasMod('wpsg_mod_request') == '1') {
-				if ($this->get_option('wpsg_page_request') === false) $this->createPage(__('Anfrageliste', 'wpsg'), 'wpsg_page_request', '-1');				
-			}
-			if ($this->get_option('wpsg_page_basket') === false) $this->createPage(__('Warenkorb', 'wpsg'), 'wpsg_page_basket', '-1');				
+				if ($this->get_option('wpsg_page_request') === false) $this->createPage(__('Anfrageliste', 'wpsg'), 'wpsg_page_request', '-1');
+			}
+			if ($this->get_option('wpsg_page_basket') === false) $this->createPage(__('Warenkorb', 'wpsg'), 'wpsg_page_basket', '-1');
 			if ($this->get_option('wpsg_page_versand') === false) $this->createPage(__('Versandkosten', 'wpsg'), 'wpsg_page_versand', '-1');
 			if ($this->get_option('wpsg_page_agb') === false) $this->createPage(__('AGB', 'wpsg'), 'wpsg_page_agb', '-1');
 			if ($this->get_option('wpsg_page_datenschutz') === false) $this->createPage(__('Datenschutz', 'wpsg'), 'wpsg_page_datenschutz', '-1');
-			if ($this->get_option('wpsg_page_widerrufsbelehrung') === false) $this->createPage(__('Widerrufsbelehrung', 'wpsg'), 'wpsg_page_widerrufsbelehrung', '-1');				
+			if ($this->get_option('wpsg_page_widerrufsbelehrung') === false) $this->createPage(__('Widerrufsbelehrung', 'wpsg'), 'wpsg_page_widerrufsbelehrung', '-1');
 			if ($this->get_option('wpsg_page_impressum') === false) $this->createPage(__('Impressum', 'wpsg'), 'wpsg_page_impressum', '-1');
 			//if ($this->get_option('wpsg_page_onlinedisputeresolution') === false) $this->createPage(__('Online Streitbeilegung', 'wpsg'), 'wpsg_page_onlinedisputeresolution', '-1');
- 			
+
 			// Bestellbedingungen aktivieren
 			$this->update_option('wpsg_mod_ordercondition', time());
-			
+
 			$this->loadModule(true);
-			
+
 			// Versandzone anlegen
 			if ($this->hasMod('wpsg_mod_versandarten'))
 			{
-			
+
 				$nVersandzonen = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_VZ."`");
-					
+
 				if ($nVersandzonen == 0)
 				{
-				
+
 					$vz_default_name = "Inland";
-				
+
 					$vz_id = $this->db->ImportQuery(WPSG_TBL_VZ, array(
 						"name" => wpsg_q($vz_default_name)
 					));
-				
+
 					$this->addTranslationString('vz_'.$vz_id, $vz_default_name);
-				
+
 					// Lieferanten anlegen
 					$nVa = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_VA."`");
-				
+
 					if ($nVa == 0)
 					{
-				
+
 						$va_default_name = "Post";
-				
+
 						$va_id = $this->db->ImportQuery(WPSG_TBL_VA, array(
 							"name" => wpsg_q($va_default_name),
@@ -301,18 +301,18 @@
 							'mwst_key' => 'c'
 						));
-							
+
 						$this->addTranslationString('wpsg_mod_versandarten_'.$va_id, $va_default_name);
-				
-					}
-				
+
+					}
+
 					// LÃ€nder anlegen
 					$nLander = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_LAND."`");
-				
+
 					if (nLander == 0)
 					{
-							
+
 						$land_default_name = "Deutschland";
 						$land_default_krzl = "DE";
-							
+
 						$land_id = $this->db->ImportQuery(WPSG_TBL_LAND, array(
 							"name" => wpsg_q($land_default_name),
@@ -325,21 +325,21 @@
 							"mwst_d" => 'NULL'
 						));
-							
+
 						$this->addTranslationString('land_'.$land_id, $land_default_name);
 						$this->addTranslationString('landkrzl_'.$land_id, $land_default_krzl);
-							
+
 						$this->update_option('wpsg_defaultland', $land_id);
-							
-					}
-				
-				}
-				
-			}
-				
+
+					}
+
+				}
+
+			}
+
 			if ($this->get_option('wpsg_kleinunternehmer_text') == '')
 				$this->update_option('wpsg_kleinunternehmer_text', __('Aufgrund der Kleinunternehmerregelung gemÃ€Ã Â§ 19 UStG wird keine Umsatzsteuer erhoben oder ausgewiesen.', 'wpsg'));
-						
+
 			if ($this->hasMod('wpsg_mod_ordercondition')) $this->arModule['wpsg_mod_ordercondition']->install();
-			
+
 			// Widerrufsformular generieren
 			if (!file_exists(WPSG_PATH_UPLOADS.'wpsg_revocation/')) mkdir(WPSG_PATH_UPLOADS.'wpsg_revocation/', 0775, true);
@@ -347,25 +347,25 @@
 			$this->render(WPSG_PATH_VIEW.'/admin/musterwiderruf.pdf.phtml');
 			$this->update_option('wpsg_revocationform', 'widerrufsformular.pdf');
-			 
+
 			$this->update_option('wpsg_installed', time(), true);
-			
+
 		} // public function firstInstall()
-		
+
 		/**
 		 * Installiert den Shop
 		 */
-		public function install() 
-		{
-			
+		public function install()
+		{
+
 			global $wpdb, $current_user;
-			 			
+
 			$this->callMods('install');
-			
+
 			// Vordefinierte Module installieren
 			$this->update_option('wpsg_mod_versandarten', time());
 			$this->update_option('wpsg_mod_prepayment', time());
 			$this->loadModule(true);
-						
-			if ($this->hasMod('wpsg_mod_versandarten')) $this->arModule['wpsg_mod_versandarten']->install();  
+
+			if ($this->hasMod('wpsg_mod_versandarten')) $this->arModule['wpsg_mod_versandarten']->install();
 			if ($this->hasMod('wpsg_mod_prepayment')) $this->arModule['wpsg_mod_prepayment']->install();
 			// Vordefinierte Module installieren ende
@@ -376,61 +376,61 @@
 			$this->checkDefault('wpsg_afterinsert', '1');
 			$this->checkDefault('wpsg_salt', base64_encode($_SERVER['REQUEST_URI'].rand(1, 1000)));
-			
+
 			// Betreffs der E-Mails vordefinieren
 			$this->checkDefault('wpsg_global_betreff', 'Allgemeiner Betreff', false, true);
 			$this->checkDefault('wpsg_global_absender', 'Shop XYZ <shop@'.$_SERVER['HTTP_HOST'].'>');
-			
+
 			$this->checkDefault('wpsg_adminmail_betreff', 'Eingang einer neuen Bestellung', false, true);
 			$this->checkDefault('wpsg_adminmail_absender', 'Shop XYZ <shop@'.$_SERVER['HTTP_HOST'].'>');
 			$this->checkDefault('wpsg_adminmail_empfaenger', 'bestellungen@'.$_SERVER['HTTP_HOST']);
-						
+
 			$this->checkDefault('wpsg_kundenmail_betreff', 'BestellbestÃ€tigung', false, true);
 			$this->checkDefault('wpsg_kundenmail_absender', 'Shop XYZ <shop@'.$_SERVER['HTTP_HOST'].'>');
-			
+
 			$this->checkDefault('wpsg_status_betreff', 'StatusÃ€nderung Ihrer Bestellung', false, true);
 			$this->checkDefault('wpsg_status_absender', 'Shop XYZ <shop@'.$_SERVER['HTTP_HOST'].'>');
-			
+
 			$this->checkDefault('wpsg_path_upload_multiblog', 'uploads/sites/%blog_id%/', true);
 
 			$this->checkDefault('wpsg_preisangaben', WPSG_BRUTTO);
 			$this->checkDefault('wpsg_preisangaben_frontend', WPSG_BRUTTO);
-			 			
-		} // public function install() 
-		
+
+		} // public function install()
+
 		/**
 		 * ÃberprÃŒft ob der Kunde $customer_id das Produkt $product_id schon gekauft hat
-		 * Wenn $customer_id = false ist, wird nach dem eingeloggten Benutzer geschaut. 
+		 * Wenn $customer_id = false ist, wird nach dem eingeloggten Benutzer geschaut.
 		 * Ist kein Benutzer eingeloggt wird false zurÃŒckgegeben
-		 * 
+		 *
 		 * Keine BerÃŒcksichtigung auf Bestellstatus
-		 * 
+		 *
 		 * @author Daschmi (07.05.2014)
-		 * 
+		 *
 		 * @param int $product_id
 		 * @param int $customer_id
-		 * 
-		 * @return boolean 
+		 *
+		 * @return boolean
 		 */
 		public function hasOrder($product_id, $customer_id = false)
 		{
-			
-			if ($customer_id === false)  
-			{
-				
-				if (wpsg_isSizedInt($_SESSION['wpsg']['checkout']['id'])) 
-				{
-					
+
+			if ($customer_id === false)
+			{
+
+				if (wpsg_isSizedInt($_SESSION['wpsg']['checkout']['id']))
+				{
+
 					$customer_id = $_SESSION['wpsg']['checkout']['id'];
-					
+
 				}
 				else
 				{
-					
+
 					return false;
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			$nCountOrder = $this->db->fetchOne("
 				SELECT
@@ -444,10 +444,10 @@
 					K.`id` = '".wpsg_q($customer_id)."'
 			");
-			
+
 			if ($nCountOrder > 0) return true;
 			else return false;
-			
+
 		} // public function hasOrder($product_id, $customer_id = false)
-		
+
 		/**
 		 * Gibt eine URL zu einer Shop Seite zurÃŒck
@@ -455,121 +455,121 @@
 		public function getURL($url_const, $mod = false, $action = false, $arParam = array(), $ForceHttps = false)
 		{
-			
+
 			switch ($url_const)
 			{
-				
-				case self::URL_VERSANDKOSTEN: 
-					
-					$url = get_permalink($this->get_option('wpsg_page_versand'));					
+
+				case self::URL_VERSANDKOSTEN:
+
+					$url = get_permalink($this->get_option('wpsg_page_versand'));
 					break;
-					
+
 				case self::URL_AGB:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_agb'));
 					break;
-				
+
 				case self::URL_DATENSCHUTZ:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_datenschutz'));
 					break;
 
 				case self::URL_BASKET:
-					
-					$url = get_permalink($this->get_option('wpsg_page_basket'));					
+
+					$url = get_permalink($this->get_option('wpsg_page_basket'));
 					break;
 
 				case self::URL_PRODUCTDETAIL:
-					
+
 					$url = get_permalink($this->getPagePID(self::URL_PRODUCTDETAIL));
-					
+
 					break;
-					
+
 				case self::URL_BASKET_AJAX:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_basket'));
 					$url .= ((strpos($url, '?') === false)?'?wpsg_basket_ajax=1':'&wpsg_basket_ajax=1');
 					break;
-										
+
 				case self::URL_WIDGET_AJAX:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_basket'));
 					$url .= ((strpos($url, '?') === false)?'?wpsg_widget_ajax=1':'&wpsg_widget_ajax=1');
 					break;
-					
+
 				case self::URL_CHECKOUT:
-					
-					if ($this->hasMod('wpsg_mod_onepagecheckout')) 
-					{
-						
+
+					if ($this->hasMod('wpsg_mod_onepagecheckout'))
+					{
+
 						$url = get_permalink($this->get_option('wpsg_mod_onepagecheckout_page'));
 						break;
-						
-					}
-					
+
+					}
+
 					$url = $this->getURL(wpsg_ShopController::URL_BASKET);
 					$url .= ((strpos($url, '?') === false)?'?wpsg_checkout':'&amp;wpsg_checkout');
 					break;
-					
+
 				case self::URL_CHECKOUT2:
-					
+
 					if ($this->hasMod('wpsg_mod_onepagecheckout')) return $this->getURL(wpsg_ShopController::URL_CHECKOUT);
-					
-					$url = $this->getURL(wpsg_ShopController::URL_BASKET);					
+
+					$url = $this->getURL(wpsg_ShopController::URL_BASKET);
 					$url .= ((strpos($url, '?') === false)?'?wpsg_checkout2':'&amp;wpsg_checkout2');
 					break;
-									
+
 				case self::URL_OVERVIEW:
-					
+
 					// Wenn Crefopay aktiv ist, gibt es keine Bestellzusammenfassung, da diese auf CrefoPay Seite angezeigt wird
 					if ($this->hasMod('wpsg_mod_crefopay'))
 					{
-						
+
 						$url = $this->callMod('wpsg_mod_crefopay', 'getDoOrderUrl');
-						
+
 					}
 					else
 					{
-					
+
 						$url = $this->getURL(wpsg_ShopController::URL_BASKET);
 						$url .= ((strpos($url, '?') === false)?'?wpsg_overview':'&amp;wpsg_overview');
 
 					}
-						
-					break;			
+
+					break;
 
 				case self::URL_WIDERRUF:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_widerrufsbelehrung'));
 					break;
-				
+
 				case self::URL_REQUEST:
-							
+
 					$url = get_permalink ($this->get_option('wpsg_page_request'));
 					break;
-				
+
 				case self::URL_ONLINE_DISPUTE_RESOLUTION:
-							
+
 					$url = $this->get_option('wpsg_page_onlinedisputeresolution');
 					break;
-					
+
 				case self::URL_IMPRESSUM:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_impressum'));
 					break;
 
 				case self::URL_PROFIL:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_mod_kundenverwaltung_profil'));
 					break;
-					
+
 				case self::URL_ORDER:
-					
-					$url = get_permalink($this->get_option('wpsg_page_mod_kundenverwaltung_order'));					
+
+					$url = get_permalink($this->get_option('wpsg_page_mod_kundenverwaltung_order'));
 					break;
-					
+
 				case self::URL_LOGOUT:
-					
+
 					$url = get_permalink($this->get_option('wpsg_page_mod_kundenverwaltung_profil'));
-					$url .= ((strpos($url, '?') === false)?'?wpsg_mod_kundenverwaltung_logout':'&amp;wpsg_mod_kundenverwaltung_logout').'&amp;wpsg_referer='.$this->getCurrentURL(); 
+					$url .= ((strpos($url, '?') === false)?'?wpsg_mod_kundenverwaltung_logout':'&amp;wpsg_mod_kundenverwaltung_logout').'&amp;wpsg_referer='.$this->getCurrentURL();
 					break;
 
@@ -578,16 +578,16 @@
 					$url = $this->callMod('wpsg_mod_kundenverwaltung', 'getPwdVergessenURL');
 					break;
-					
-			}
-			
+
+			}
+
 			if (wpsg_isSizedString($mod)) $url .= ((strpos($url, '?') === false)?'?':'&').'wpsg_mod='.$mod;
 			if (wpsg_isSizedString($action)) $url .= ((strpos($url, '?') === false)?'?':'&').'wpsg_action='.$action;
 			if (wpsg_isSizedArray($arParam)) $url .= ((strpos($url, '?') === false)?'?':'&').http_build_query($arParam);
 			if ($ForceHttps === true) $url = preg_replace('/^http:/', 'https:', $url);
-						
+
 			return $url;
-			
+
 		} // public function getURL($url_const, $entity = false)
-		
+
 		/**
 		 * Checkt den Request und entfernt mÃ¶glicherweise escapte Variablen
@@ -595,18 +595,18 @@
 		public function checkEscape()
 		{
-			
+
 			if (strlen($_GET['wpsg_quotecheck']) > 7 || get_magic_quotes_gpc())
 			{
-				
+
 				$_POST      = array_map('stripslashes_deep', $_POST);
 			    $_GET       = array_map('stripslashes_deep', $_GET);
 			    $_COOKIE    = array_map('stripslashes_deep', $_COOKIE);
 			    $_REQUEST   = array_map('stripslashes_deep', $_REQUEST);
-			    
+
 			    // Damit es bei mehrfachen Aufruf durch Module nicht erneut gemacht wird
 			    $_GET['wpsg_quotecheck'] = '\"CHECK';
-			    
-			}
-			
+
+			}
+
 		} // public function checkEscape()
 
@@ -616,31 +616,31 @@
 		 */
 		public function canDisplayPrice()
-		{  
-			
+		{
+
 			$wpsg_mod_kundenverwaltung_preisAnzeige = $this->get_option('wpsg_mod_kundenverwaltung_preisAnzeige');
-			
+
 			if (wpsg_isSizedInt($wpsg_mod_kundenverwaltung_preisAnzeige))
 			{
-								 
+
 				// Preis und Kauf nur fÃŒr angemeldete Benutzer
 				$isLoggedIn = $this->callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn');
-				
+
 				if (wpsg_isSizedInt($isLoggedIn))
 				{
-					
+
 					return true;
-					
+
 				}
 				else
 				{
-					
+
 					return false;
-					
-				}
-				
+
+				}
+
 			} else return true;
-			
+
 		} // public function canDisplayPrice()
-		
+
 		/**
 		 * Initiiert den Shop
@@ -649,57 +649,57 @@
 		public function initShop($prefix)
 		{
-			 		
+
 			if (is_admin() && defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN == true)
 			{
-				
+
 				// Backend lÃ€uft mit SSL
-				 
-				
-			}			
-			
+
+
+			}
+
 			if (preg_match('/update-core\.php/', $_SERVER['PHP_SELF']) || preg_match('//', $_SERVER['PHP_SELF']))
 			{
-				
+
 				$this->update_option('wpsg_lastupdate', false);
-				
-			}
-			
+
+			}
+
 			if (wpsg_isSizedInt($this->get_option('wpsg_autolineending'))) @ini_set('auto_detect_line_endings', true);
-			
+
 			$this->prefix = $prefix;
 			$this->basket = new wpsg_basket();
-			
+
 			if ($this->get_option('wpsg_installed', true) > 0)
 			{
-			 
+
 				$this->loadModule();
-				
+
 				// Hier mÃŒssen die Ãnderungen der Session gespeichert werden
-				if (wpsg_isSizedArray($_REQUEST['wpsg']['checkout'])) 
-				{
-				
+				if (wpsg_isSizedArray($_REQUEST['wpsg']['checkout']))
+				{
+
 					$_SESSION['wpsg']['checkout'] = wpsg_xss(
 						wpsg_array_merge(
-							(array)$_SESSION['wpsg']['checkout'], 
+							(array)$_SESSION['wpsg']['checkout'],
 							wpsg_trim($_REQUEST['wpsg']['checkout'], false)
 						)
-					); 
-					
-				}
-												
-			} 
-			
+					);
+
+				}
+
+			}
+
 		} // public function initShop()
-				
+
 		public function wp_enqueue()
 		{
-						
+
 			wp_enqueue_script('jquery');
-										
+
 			if (is_admin() && preg_match('/wpsg/', wpsg_getStr($_REQUEST['page'])))
 			{
 
 				wp_enqueue_script('wpsg_bsjs', $this->getRessourceURL('js/bootstrap-3.3.6-dist/js/bootstrap.min.js'));
-				
+
 				wp_enqueue_script('common');
 
@@ -708,5 +708,5 @@
 				wp_enqueue_script('wpsg_bs_editable', $this->getRessourceURL('js/bootstrap3-editable-1.5.1/bootstrap3-editable/js/bootstrap-editable.js'));
 				wp_enqueue_script('wpsg_editable', $this->getRessourceURL('js/editable.js'));
-				 
+
 				wp_enqueue_script('utils');
 				wp_enqueue_script('jquery-color');
@@ -717,19 +717,19 @@
 				wp_enqueue_script('jquery-ui-datepicker'); //, $this->url(WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/lib/ui/jquery.ui.datepicker.js'), array('jquery', 'jquery-ui-core'));
 				wp_enqueue_script('jquery-ui-datepicker-de', $this->url(WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/lib/ui/jquery.ui.datepicker-de.js'), array('jquery', 'jquery-ui-core'));
-			
+
 				//if (in_array(wpsg_getStr($_REQUEST['page']), array('wpsg-Admin', 'wpsg-Produkt', 'wpsg-Order')))
 				{
-				
+
 					wp_enqueue_style('wpsg-bscss', $GLOBALS['wpsg_sc']->getRessourceURL('js/bootstrap-3.3.6-dist/css/bootstrap.css'));
 					wp_enqueue_style('wpsg-bs-theme-css', $GLOBALS['wpsg_sc']->getRessourceURL('js/bootstrap-3.3.6-dist/css/bootstrap-theme.css'));
 					wp_enqueue_style('wpsg_bs_editable', $GLOBALS['wpsg_sc']->getRessourceURL('js/bootstrap3-editable-1.5.1/bootstrap3-editable/css/bootstrap-editable.css'));
-					
-				}
-				
+
+				}
+
 				wp_enqueue_style('wp-jquery-ui-dialog');
 				wp_enqueue_style('jquery-ui-datepicker');
 				wp_enqueue_style('wpsg-adminstyle', $GLOBALS['wpsg_sc']->getRessourceURL('css/admin.css'), array('wpsg-bscss', 'wpsg-bs-theme-css'));
-				
-				wp_localize_script('wpsg_adminjs', 'wpsg_ajax', array(					
+
+				wp_localize_script('wpsg_adminjs', 'wpsg_ajax', array(
 					'img_ajaxloading' => $this->getRessourceURL('gfx/ajax-loader.gif'),
 					'label_pleasewait' => __('Bitte warten', 'wpsg'),
@@ -738,16 +738,19 @@
 					'ie_validate_empty' => __('Bitte machen Sie hier eine Angabe.', 'wpsg')
 				));
-				
+
 			}
 			else if (!is_admin())
 			{
-			
-				if ($this->get_option('wpsg_load_css') != '1') wp_enqueue_style('wpsg-frontendstyle', $this->getRessourceURL('css/frontend.css'));			
+
+				//wp_enqueue_style('wpsg-bscss', $GLOBALS['wpsg_sc']->getRessourceURL('js/bootstrap-3.3.6-dist/css/bootstrap.css'));
+				if ($this->get_option('wpsg_load_bootstrap_glyphfont_css') == '1') wp_enqueue_style('wpsg-bscss', $GLOBALS['wpsg_sc']->getRessourceURL('js/bootstrap-3.3.6-dist/css/bootstrap-glyphfont.css'));
+
+				if ($this->get_option('wpsg_load_css') != '1') wp_enqueue_style('wpsg-frontendstyle', $this->getRessourceURL('css/frontend.css'));
 				if ($this->get_option('wpsg_load_thickbox_js') == '1') wp_enqueue_script('thickbox', null, array('jquery'));
-				if ($this->get_option('wpsg_load_thickbox_css') == '1') wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0');			 
+				if ($this->get_option('wpsg_load_thickbox_css') == '1') wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0');
 				if ($this->get_option('wpsg_load_jquery') == '1') wp_enqueue_script('jquery');
-				
+
 				wp_enqueue_script('wpsg_frontend', $this->getRessourceURL('js/frontend.js'), array('jquery'));
-				
+
 				wp_localize_script('wpsg_frontend', 'wpsg_ajax', array(
 					'ajaxurl' => $this->getURL(wpsg_ShopController::URL_BASKET),
@@ -759,17 +762,17 @@
 					'label_pleasewait' => __('Bitte warten', 'wpsg')
 				));
-				
+
 				// Validierung
 				if ($this->get_option('wpsg_load_validierung_js') == '1')
 				{
-				
+
 					switch ($this->get_option('wpsg_form_validation'))
 					{
-				
+
 						case '1': // Validierung V1
-								
+
 							wp_enqueue_script('jquery-validation-de', $this->getRessourceURL('js/jquery.validationEngine-de.js'), array('jquery'));
 							wp_enqueue_script('jquery-validation', $this->getRessourceURL('js/jquery.validationEngine.js'), array('jquery'));
-				
+
 							wp_localize_script('jquery-validation-de', 'wpsg_trans_v1', array(
 								'required_alertText' => __('* Dieses Feld ist ein Pflichtfeld', 'wpsg'),
@@ -807,12 +810,12 @@
 								'vname_alertText' => __('* Bitte geben Sie einen Vorname an.', 'wpsg')
 							));
-								
+
 							break;
-				
+
 						case '2': // Validierung V2
-								
+
 							wp_enqueue_script('wpsg-validation', $this->getRessourceURL('js/jquery-validation-1.11.1/dist/jquery.validate.min.js'), array('jquery'));
 							wp_enqueue_script('wpsg-validation-2', $this->getRessourceURL('js/jquery-validation-1.11.1/dist/additional-methods.min.js'), array('jquery'));
-				
+
 							wp_localize_script('wpsg-validation', 'wpsg_trans_v2', array(
 								'required' => __('Dieses Feld ist ein Pflichtfeld.', 'wpsg'),
@@ -833,39 +836,39 @@
 								'min' => __('Minimalwert {0}.', 'wpsg')
 							));
-							
+
 							break;
-				
-					}
-				
-				}
-				
+
+					}
+
+				}
+
 				if ($this->get_option('wpsg_load_validierung_css') == '1')
 				{
-						
+
 					switch ($this->get_option('wpsg_form_validation'))
 					{
-				
+
 						case '1': // Validierung V1
-				
+
 							wp_enqueue_style('wpsg-validation',$this->getRessourceURL('css/validationEngine.jquery.css'));
-								
+
 							break;
-								
+
 						case '2': // Validierung V2
-								
+
 							// Hat nix
-				
+
 							break;
-				
-					}
-						
-				}
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			$GLOBALS['wpsg_sc']->callMods('wpsg_enqueue_scripts');
-						
+
 		}
-			
+
 		/**
 		 * Ruft die Funktion $func_name in den Modulen auf und ÃŒbergibt ihnen $arParam
@@ -874,26 +877,26 @@
 		public function callMods($func_name, $arParam = array())
 		{
-			
+
 			foreach ($this->arModule as $m_key => $m)
 			{
-				
+
 				if (method_exists($m, $func_name))
 				{
 
 					//wpsg_debug_console($func_name.":".get_class($m));
-					
+
 					$b = call_user_func_array(array($m, $func_name), $arParam);
-				
+
 					if ($b == -1) break;
 					else if ($b == -2) return false;
-					
-				}
-				
+
+				}
+
 			}
 
 			return true;
-			
+
 		} // public function callMods($func_name)
-		
+
 		/**
 		 * Ruft eine spezielle Funktion eines speziellen Moduls auf
@@ -901,19 +904,19 @@
 		public function callMod($mod_key, $func_name, $arParam = array())
 		{
-			
+
 			if (!array_key_exists($mod_key, $this->arModule)) return;
-			
+
 			if (method_exists($this->arModule[$mod_key], $func_name))
 			{
-				
+
 				return call_user_func_array(array($this->arModule[$mod_key], $func_name), $arParam);
-				
-			}
-			
+
+			}
+
 		} // public function callMod($mod_key, $func_name, $arParam = array())
-			
+
 		/**
 		 * Ruft eine URL auf
-		 * $typ = 0 Bei Kauf eines Produktes 
+		 * $typ = 0 Bei Kauf eines Produktes
 		 * $typ = 1 Bei Bezahlung eines Produktes
 		 * $typ = 2 Bei erstellung einer Rechnung
@@ -922,7 +925,7 @@
 		public function notifyURL($url, $produkt_key, $menge, $order_id, $typ, $custom = false, $customSet = false)
 		{
-			
+
 			$arSend = array();
-									
+
 			switch ($typ)
 			{
@@ -933,36 +936,36 @@
 				default: die(__('UngÃŒltige Anfrage!', 'wpsg'));
 			}
-						
+
 			$arSend['time'] = time();
-			
+
 			if (wpsg_isSizedArray($customSet))
 			{
-				
+
 				foreach ($customSet as $k => $v)
 				{
-					
+
 					$arSend[$k] = $v;
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			// Produktdaten an den Array hÃ€ngen
 			if ($produkt_key != false)
 			{
-				
-				$arSend['produkt_key'] = $produkt_key;				
-				$produkt_data = $this->cache->loadProduct($this->getProduktID($produkt_key));				
+
+				$arSend['produkt_key'] = $produkt_key;
+				$produkt_data = $this->cache->loadProduct($this->getProduktID($produkt_key));
 				foreach ($produkt_data as $k => $v) $arSend['product_'.$k] = $v;
-				
-			}
-			
+
+			}
+
 			if ($menge != false)
 			{
-				
+
 				$arSend['menge'] = $menge;
-				
-			}
-			
+
+			}
+
 			if ($order_id > 0)
 			{
@@ -970,10 +973,10 @@
 				$order_data = $this->cache->loadOrder($order_id);
 				$customer_data = $this->cache->loadKunden($order_data['k_id']);
-				
+
 				foreach ($order_data as $k => $v) $arSend['order_'.$k] = $v;
 				foreach ($customer_data as $k => $v) $arSend['customer_'.$k] = $v;
-				
+
 				$this->callMods('notifyURL', array(&$url, &$produkt_key, &$menge, &$order_id, &$typ, &$arSend));
-				
+
 				/* Veraltet: */
 				$arSend['order'] = $this->db->fetchRow("
@@ -985,8 +988,8 @@
 						O.`id` = '".wpsg_q($order_id)."'
 				");
-				
+
 				if ($arSend['order']['k_id'] > 0)
 				{
-					
+
 					$arSend['kunde'] = $this->db->fetchRow("
 						SELECT
@@ -995,39 +998,39 @@
 							`".WPSG_TBL_KU."` AS K
 						WHERE
-							K.`id` = '".wpsg_q($arSend['order']['k_id'])."'						
+							K.`id` = '".wpsg_q($arSend['order']['k_id'])."'
 					");
-					
+
 				}
 				/* Veraltet ENDE */
-				
-			}
-			
+
+			}
+
 			// Kontrollhash
 			$hash = md5($this->get_option('wpsg_salt').$arSend['time']);
 			$arSend['hash'] = $hash;
-			
+
 			// CURL Aufruf
 			$curl = curl_init($url);
 			curl_setopt($curl, CURLOPT_POST, 1);
 			curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($arSend, '', '&'));
-			
-			if (!ini_get('safe_mode') && !ini_get('open_basedir')) 
-			{
-				
+
+			if (!ini_get('safe_mode') && !ini_get('open_basedir'))
+			{
+
 				/*
 				 * TRUE um jedem "Location: "-Header zu folgen, den der Server als Teil der HTTP-Header zurÃŒckgibt. Die Verarbeitung erfolgt rekursiv, PHP wird jedem "Location: "-Header folgen, sofern nicht CURLOPT_MAXREDIRS gesetzt ist.
-				 * Kann im Safemode nicht geÃ€ndert werden 
+				 * Kann im Safemode nicht geÃ€ndert werden
 				 */
 				curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
-				
-			}
-			
-			curl_setopt($curl, CURLOPT_HEADER, 0); 
+
+			}
+
+			curl_setopt($curl, CURLOPT_HEADER, 0);
 			curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
-			
+
 			$Rec_Data = curl_exec($curl);
 
 			return $Rec_Data;
-			
+
 		} // public function notifyURL($url, $produkt_key, $order_id, $typ)
 
@@ -1038,88 +1041,88 @@
 		public function getCurrentURL()
 		{
-			
+
 			$myReferer = "";
-			
+
 			if ($this->get_option('wpsg_referer_requesturi') == '1')
 			{
-			
+
 				if (function_exists('qtrans_convertURL'))
 				{
-			
+
 					$myReferer =  qtrans_convertURL($_SERVER["REQUEST_URI"]);
-			
+
 				}
 				else
 				{
-			
+
 					$myReferer = $_SERVER['REQUEST_URI'];
-						
-				}
-			
+
+				}
+
 			}
 			else
 			{
-					
+
 				if (is_page())
 				{
-						
+
 					$myReferer = get_permalink(get_the_id());
-						
+
 				}
 				else
 				{
-						
+
 					if (wpsg_isSizedString($_SERVER['REDIRECT_URL']))
 					{
-			
+
 						$myReferer .= $_SERVER['REDIRECT_URL'];
-						
+
 					}
 					else
 					{
-							
+
 						$myReferer = "";
-						
+
 						if (isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI']))
 						{
-							
+
 							$myReferer = $_SERVER['REQUEST_URI'];
-							
+
 						}
 						else if (isset($_SERVER['SCRIPT_URL']) && !empty($_SERVER['SCRIPT_URL']))
 						{
-							
+
 							$myReferer = $_SERVER['SCRIPT_URL'];
-							
+
 						}
-			
+
 						if ($_SERVER['QUERY_STRING'] != '' && stripos($_SERVER['QUERY_STRING'], $myReferer) !== false)
 						{
-							
+
 							if (strpos($myReferer, '?') > 0)
 							{
-								
+
 								$myReferer .= '&'.$_SERVER['QUERY_STRING'];
-								
+
 							}
 							else
 							{
-								
+
 								$myReferer .= '?'.$_SERVER['QUERY_STRING'];
-								
+
 							}
-							
+
 						}
-							
-					}
-					
-				}
-			
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			return $myReferer;
-			
+
 		} // public function getCurrentURL()
-		
+
 		/**
 		 * Gibt die Ausgabe fÃŒr ein Produkt zurÃŒck
@@ -1127,23 +1130,23 @@
 		public function renderProdukt($produkt_id, $force_template = false, $force_locale = false)
 		{
-			
+
 			global $locale, $l10n;
 
 			if (!$this->hasActiveLicence() && $this->getDemoDays() <= 0)
 			{
-			
+
 				// Ihre <a title="Informationen ÃŒber das wpShopGermandy Wordpress Shop Plugin System" href="http://wpshopgermany.de">wpShopGermany</a> <a href="http://shop.maennchen1.de/produkte/wpshopgermany-lizenzkey/" title="wpShopGermany Wordpress Shop Plugin System Lizenz erwerben">Lizenz</a> ist abgelaufen.<br />
 				return base64_decode('SWhyZSA8YSB0aXRsZT0iSW5mb3JtYXRpb25lbiDDvGJlciBkYXMgd3BTaG9wR2VybWFuZHkgV29yZHByZXNzIFNob3AgUGx1Z2luIFN5c3RlbSIgaHJlZj0iaHR0cDovL3dwc2hvcGdlcm1hbnkuZGUiPndwU2hvcEdlcm1hbnk8L2E+IDxhIGhyZWY9Imh0dHA6Ly9zaG9wLm1hZW5uY2hlbjEuZGUvcHJvZHVrdGUvd3BzaG9wZ2VybWFueS1saXplbnprZXkvIiB0aXRsZT0id3BTaG9wR2VybWFueSBXb3JkcHJlc3MgU2hvcCBQbHVnaW4gU3lzdGVtIExpemVueiBlcndlcmJlbiI+TGl6ZW56PC9hPiBpc3QgYWJnZWxhdWZlbi48YnIgLz4=');
-					
-			}
-			
+
+			}
+
 			if ($force_locale !== false && file_exists(dirname(__FILE__).'/../lang/wpsg-'.$force_locale.'.mo'))
 			{
 
-				$old_l10n = clone $l10n['wpsg']; 
+				$old_l10n = clone $l10n['wpsg'];
 				$this->force_locale = $force_locale;
-				
+
 				// Hier muss load_(text)domain genommen werden, sonst ging es nicht!
-				// Damit das Plugin nicht warnt, habe ich es bissl verscrambelt				
+				// Damit das Plugin nicht warnt, habe ich es bissl verscrambelt
 				// load_(text)domain('wpsg', dirname(__FILE__).'/../lang/wpsg-'.$force_locale.'.mo');
 				call_user_func_array(
@@ -1153,8 +1156,8 @@
 					)
 				);
-				 									
-			}
-			
-			if (wpsg_isSizedArray($produkt_id)) 
+
+			}
+
+			if (wpsg_isSizedArray($produkt_id))
 			{
 
@@ -1163,27 +1166,27 @@
 
 			}
-			else 
-			{
-				
+			else
+			{
+
 				$this->view['data'] = $this->loadProduktArray($produkt_id);
-				
-			}
-			 
+
+			}
+
 			if (wpsg_isSizedInt($this->view['data']['pstatus'])) return '';
-			
+
 			// Produkt, bei dem die EU Leistungsortregel gilt ?
-			if (wpsg_isSizedInt($this->view['data']['euleistungsortregel'])) $this->showEULayer = true;			
-			
+			if (wpsg_isSizedInt($this->view['data']['euleistungsortregel'])) $this->showEULayer = true;
+
 			if ($this->view['data']['deleted'] == '1') return;
-			
+
 			if ($force_template !== false)
 			{
 				$this->view['data']['ptemplate_file'] = $force_template;
 			}
-			
+
 			$template_file = WPSG_PATH_PRODUKTTEMPLATES.$this->view['data']['ptemplate_file'];
 
 			$this->callMods('renderProdukt_templateSelect', array(&$this->view['data'], &$template_file));
-			
+
 			// Das Template im UserView suchen
 			$template_file_uv = str_replace(WPSG_PATH_PRODUKTTEMPLATES, WPSG_PATH_PRODUKTTEMPLATES_UV, $template_file);
@@ -1191,30 +1194,30 @@
 			$template_file_theme = str_replace(WPSG_PATH_PRODUKTTEMPLATES, WPSG_PATH_PRODUKTTEMPLATES_TV, $template_file);
 			$template_file_child_theme = str_replace(WPSG_PATH_PRODUKTTEMPLATES, WPSG_PATH_PRODUKTTEMPLATES_CTV, $template_file);
-			
+
 			if (file_exists($template_file_theme) && $this->get_option('wpsg_ignoreuserview') != '1') $template_file = $template_file_theme;
-			if (file_exists($template_file_child_theme) && $this->get_option('wpsg_ignoreuserview') != '1') $template_file = $template_file_child_theme;			
-			if (file_exists($template_file_uv_old) && $this->get_option('wpsg_ignoreuserview') != '1') $template_file = $template_file_uv_old;						
+			if (file_exists($template_file_child_theme) && $this->get_option('wpsg_ignoreuserview') != '1') $template_file = $template_file_child_theme;
+			if (file_exists($template_file_uv_old) && $this->get_option('wpsg_ignoreuserview') != '1') $template_file = $template_file_uv_old;
 			if (file_exists($template_file_uv) && $this->get_option('wpsg_ignoreuserview') != '1') $template_file = $template_file_uv;
-			 
+
 			if (!is_file($template_file)) { wpsg_debug(wpsg_translate(__('Das Template (#1#) fÃŒr ein Produkt (ID:#2#) scheint nicht zu existieren!', 'wpsg'), $template_file, $produkt_id)); return; }
-			
+
 			// Den Index fÃŒr getTemplateIndex hochzÃ€hlen
 			wpsg_addSet($GLOBALS['wpsg_produkt_index'], 1);
 			$this->view['product_index'] = $GLOBALS['wpsg_produkt_index'];
-						
+
 			if (!wpsg_isSizedString($this->view['data']['referer'])) $myReferer = $this->getCurrentURL();
 			else $myReferer = $this->view['data']['referer'];
-			
+
 			if (!wpsg_isSizedString($this->view['data']['product_key'])) $this->view['data']['product_key'] = $this->view['data']['id'];
-			  
+
 			$this->view['data']['id'] = $this->getProduktId($this->view['data']['id']);
 
 			$this->view['oProduct'] = wpsg_product::getInstance($this->view['data']['id']);
 			$this->view['oProduct']->appendData($this->view['data']);
-			
+
 			if (wpsg_isSizedString($this->view['data']['product_key'])) $this->view['oProduct']->setProductKey($this->view['data']['product_key']);
-									
+
 			$html  = '';
-			$html .= '<form class="wpsg_productform" id="wpsg_produktform_'.$GLOBALS['wpsg_produkt_index'].'" method="post" action="'.$myReferer.'">';		
+			$html .= '<form class="wpsg_productform" id="wpsg_produktform_'.$GLOBALS['wpsg_produkt_index'].'" method="post" action="'.$myReferer.'">';
 			$html .= $this->render($template_file, false);
 			$html .= '<div style="display:none;">';
@@ -1222,7 +1225,7 @@
 			$html .= '<input type="hidden" name="myReferer" value="'.htmlspecialchars($myReferer).'" />';
 			$html .= '<input type="hidden" name="wpsg[produkt_id]" value="'.$this->getProduktId($produkt_id).'" />';
-			$html .= '</div>';			
+			$html .= '</div>';
 			$html .= '</form>';
-			
+
 			$this->callMods('renderProdukt_afterForm', array(&$this->view['data'], &$html));
 
@@ -1230,22 +1233,22 @@
 			if ($force_locale !== false)
 			{
-				
+
 				if (isset($old_l10n))
 				{
-				
+
 					$l10n['wpsg'] = &$old_l10n;
-					
-				}
- 				
+
+				}
+
 				$this->force_locale = false;
-				
-			}
-			
+
+			}
+
 			$this->titleDisplayed = false;
-			
+
 			return $html;
-			
+
 		} // public function renderProdukt($produkt_id)
- 				
+
 		/**
 		 * Shortcode fÃŒr Warenkorbbutton, um Produkte aus KategorieÃŒbersicht in Warenkorb zu legen (muss in jedem Beitrag eingefÃŒgt werden)
@@ -1253,33 +1256,33 @@
 		public function shortcode_basket($atts, $content = '')
 		{
-			
+
 			$product_id = wpsg_getStr($atts['product']);
 			$title = wpsg_getStr($atts['title']);
 			$linktext = wpsg_getStr($atts['linktext']);
-				
+
 			/* Wenn kein Linktext im Beitrag, Linktext aus Template */
 			if (!wpsg_isSizedString($linktext)) $linktext = __('Produkt in den Warenkorb legen', 'wpsg');
-				
+
 			$product_url = $this->getProduktLink($product_id);
-				
+
 			$strReturn = '<a class="wpsg_button wpsg_button_categorie_basket wpsg_addProdukt ';
-				
+
 			/* Varianten=true -> ï¿œffnet Lightbox mit Variantenauswahl */
 			$strReturn .= (($this->callMod('wpsg_mod_productvariants', 'isVariantsProduct', array($product_id)))?'wpsg_variantProduct':'');
-				
+
 			$strReturn .= '" ';
-				
+
 			$strReturn .= ' data-product_id="'.wpsg_hspc($product_id).'" ';
-				
+
 			$strReturn .= ' href="'.wpsg_url($product_url).'" ';
-				
+
 			$strReturn .= ' title="'.wpsg_hspc($title).'" ';
-				
+
 			$strReturn .= '>'.wpsg_hspc($linktext).'</a>';
-				
+
 			return $strReturn;
-				
+
 		}
-		
+
 		/**
 		 * Verarbeitet den Shortcode wpsg
@@ -1287,123 +1290,123 @@
 		public function shortcode($atts, $content = '')
 		{
-			
+
 			try
 			{
-			
+
 				$this->bShortcode = true;
-			
+
 				if (!$this->hasActiveLicence() && $this->getDemoDays() <= 0)
 				{
-	
+
 					// Ihre <a title="Informationen ÃŒber das wpShopGermandy Wordpress Shop Plugin System" href="http://wpshopgermany.de">wpShopGermany</a> <a href="http://shop.maennchen1.de/produkte/wpshopgermany-lizenzkey/" title="wpShopGermany Wordpress Shop Plugin System Lizenz erwerben">Lizenz</a> ist abgelaufen.<br />
 					return base64_decode('SWhyZSA8YSB0aXRsZT0iSW5mb3JtYXRpb25lbiDDvGJlciBkYXMgd3BTaG9wR2VybWFuZHkgV29yZHByZXNzIFNob3AgUGx1Z2luIFN5c3RlbSIgaHJlZj0iaHR0cDovL3dwc2hvcGdlcm1hbnkuZGUiPndwU2hvcEdlcm1hbnk8L2E+IDxhIGhyZWY9Imh0dHA6Ly9zaG9wLm1hZW5uY2hlbjEuZGUvcHJvZHVrdGUvd3BzaG9wZ2VybWFueS1saXplbnprZXkvIiB0aXRsZT0id3BTaG9wR2VybWFueSBXb3JkcHJlc3MgU2hvcCBQbHVnaW4gU3lzdGVtIExpemVueiBlcndlcmJlbiI+TGl6ZW56PC9hPiBpc3QgYWJnZWxhdWZlbi48YnIgLz4=');
-				
-				}
-				
+
+				}
+
 				if (isset($atts['template']))
 				{
-					
-					$template = $atts['template']; 
-					
+
+					$template = $atts['template'];
+
 				}
 				else if (isset($atts['produktgruppe']))
 				{
-					
+
 					return $this->callMod('wpsg_mod_productgroups', 'shortcode', array($atts));
-					
+
 				}
 				else
 				{
-					
+
 					$template = false;
-					
-				}
-				 
+
+				}
+
 				if ($atts['product'] === '-1')
 				{
-											
-					$arProductIDs = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` <= 0 ORDER BY `id` ASC ");		
+
+					$arProductIDs = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` <= 0 ORDER BY `id` ASC ");
 					$content = '';
-					
+
 					foreach ($arProductIDs as $product_id)
 					{
-						
+
 						if (isset($atts['hide_title']) && $atts['hide_title'] === '1') $this->titleDisplayed = true;
 						else $this->titleDisplayed = false;
-						
+
 						$oProduct = wpsg_product::getInstance($product_id);
-						
+
 						if ($oProduct->canDisplay()) $content .= $this->renderProdukt($product_id, $template);
-						
-					}
-					
+
+					}
+
 					return $content;
-					
+
 				}
 				else
 				{
-					
+
 					if (isset($atts['hide_title']) && $atts['hide_title'] === '1') $this->titleDisplayed = true;
 					else $this->titleDisplayed = false;
-				 
+
 					return $this->renderProdukt($atts['product'], $template);
-						
-				}
-				
+
+				}
+
 				$this->bShortcode = false;
-				
+
 			}
 			catch (Exception $e)
 			{
-				
+
 				return $e->getMessage();
-				
-			}
-			
+
+			}
+
 		} // public function shortcode($atts, $content = '')
-		
+
 		/**
 		 * Checkt und setzt die Kundenvorgaben in der Session, sollte nichts eingetragen sein
-		 * Setzt auch die Variablen fÃŒr das Template 
-		 * 
+		 * Setzt auch die Variablen fÃŒr das Template
+		 *
 		 * Hier kann noch nicht nach vorhandensein der Zahlungsarten in this->arShipping geschaut werden!
 		 */
 		public function checkCustomerPreset()
 		{
-			
+
 			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping']) && wpsg_isSizedString($this->get_option('wpsg_customerpreset_shipping')))
 			{
-				
+
 				$_SESSION['wpsg']['checkout']['shipping'] = $this->get_option('wpsg_customerpreset_shipping');
 				if (isset($this->view['basket'])) $this->view['basket']['checkout']['shipping'] = $_SESSION['wpsg']['checkout']['shipping'];
-				
-			}
-			
+
+			}
+
 			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['payment']) && wpsg_isSizedString($this->get_option('wpsg_customerpreset_payment')))
-			{ 
-				
+			{
+
 				$_SESSION['wpsg']['checkout']['payment'] = $this->get_option('wpsg_customerpreset_payment');
 				if (isset($this->view['basket'])) $this->view['basket']['checkout']['payment'] = $_SESSION['wpsg']['checkout']['payment'];
-				
-			}
-						
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['land']) && wpsg_isSizedString($this->get_option('wpsg_defaultland'))) 
-			{
-				
+
+			}
+
+			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']['title']) && wpsg_isSizedString($this->get_option('wpsg_customerpreset_title')))
 			{
-				
+
 				$_SESSION['wpsg']['checkout']['title'] = $this->get_option('wpsg_customerpreset_title');
 				if (isset($this->view['basket'])) $this->view['basket']['checkout']['title'] = $_SESSION['wpsg']['checkout']['land'];
-				
-			}
-			
+
+			}
+
 		} // public function checkCustomerPreset()
-				 		
+
 		/**
 		 * Registriert die im Shop verwendeten Widgets
@@ -1411,11 +1414,11 @@
 		public function widget_init()
 		{
-			
+
 			require_once(dirname(__FILE__).'/../lib/wpsg_basket_widget.class.php');
-			
+
 			register_widget("wpsg_basket_widget");
-			
+
 		} // public function widget_init()
-				
+
 		/**
 		 * Gibt das Standardland als wpsg_country Objekt zurÃŒck
@@ -1424,17 +1427,17 @@
 		public function getDefaultCountry($id = false)
 		{
-			
+
 			$country_id = $this->get_option('wpsg_defaultland');
-			
+
 			// Kein Standardland, hier kann nichts zurÃŒckgegeben werden
 			if ($country_id === false) return false;
-			
+
 			if ($id === false)
 			{
-			
+
 				$default_country = wpsg_country::getInstance($country_id);
-			 
+
 				return $default_country;
-				
+
 			}
 			else
@@ -1442,9 +1445,9 @@
 
 				return $country_id;
-			
-			} 
-			
+
+			}
+
 		} // public function getDefaultCountry()
-		 
+
 		/**
 		 * Gibt das aktuelle Land fÃŒr die Frontendausgabe zurÃŒck
@@ -1453,34 +1456,34 @@
 		public function getFrontendCountry($id = false)
 		{
-			 
+
 			if (wpsg_isSizedInt($_SESSION['wpsg']['checkout']['land']))
 			{
-				
+
 				$country_id = $_SESSION['wpsg']['checkout']['land'];
-								
+
 			}
 			else
 			{
-				
+
 				return $this->getDefaultCountry($id);
-				
-			}
-			
+
+			}
+
 			if ($id === false)
 			{
-					
+
 				$oCountry = wpsg_country::getInstance($country_id);
 				return $oCountry;
-					
+
 			}
 			else
 			{
-					
+
 				return $country_id;
-					
-			}
-			 
+
+			}
+
 		} // public function getFrontendCountry()
-		
+
 		/**
 		 * Gibt den Mehrwertsteuer Wert zurÃŒck,
@@ -1492,7 +1495,7 @@
 			$country = $this->getDefaultCountry();
 			return $country->getTax($tax_key);
-			
+
 			//$country = $this->getFrontendCountry();
-			
+
 			$noMwSt = false;
 
@@ -1500,23 +1503,23 @@
 			// 2 = keine MwSt. bei USt.IdNr.
 			if ($country->mwst == 1) $noMwSt = true;
-			if ($country->mwst == 2 && wpsg_isSizedString($this->basket->arCheckout['ustidnr'])) $noMwSt = true; 
- 
+			if ($country->mwst == 2 && wpsg_isSizedString($this->basket->arCheckout['ustidnr'])) $noMwSt = true;
+
 			if ($noMwSt)
 			{
-				
+
 				// Hier die MwSt des Standardlandes fÃŒr Berechnung verwenden
 				$country = $this->getDefaultCountry();
-				return $country->getTax($tax_key);	
-				
-			}			
-			else 
-			{
-
 				return $country->getTax($tax_key);
-				
-			}
-			 
+
+			}
+			else
+			{
+
+				return $country->getTax($tax_key);
+
+			}
+
 		}
-		
+
 		/**
 		 * LÃ€dt die Daten eines Produktes
@@ -1524,28 +1527,28 @@
 		public function loadProduktArray($produkt_id, $override = array())
 		{
-		
+
 			$produkt = $this->cache->loadProduct($produkt_id);
-					
+
 			if (!wpsg_isSizedArray($produkt)) throw new \wpsg\Exception('Produkt (ID:'.$produkt_id.') konnte nicht geladen werden.');
-			 
+
 			foreach ($override as $k => $v) $produkt[$k] = $v;
-						  
+
 			// Ãbersetzung einbeziehen
 			if ($this->isOtherLang())
 			{
-				
+
 				$produkt_trans = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($produkt_id)."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
 
 				if ($produkt_trans['id'] > 0)
 				{
-					
+
 					$produkt['name'] = $produkt_trans['name'];
 					$produkt['beschreibung'] = $produkt_trans['beschreibung'];
 					$produkt['detailname'] = $produkt_trans['detailname'];
-					 
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			// Daten aus Order-Produkt nehmen, da die Bestellung im Backend bearbeitbar ist
 			if (isset($produkt['op_mwst_key']))
@@ -1556,67 +1559,67 @@
 				$produkt['preis_brutto'] = $produkt['price_brutto'];
 				//$produkt['mwst_value'] = $produkt['op_mwst_value'];
-			}	
+			}
 
 			$produkt['product_id'] = $this->getProduktID($produkt_id);
-			$produkt['mwst_value'] = $this->getCalcTaxValue($produkt['mwst_key']); 
-			
-			// Preis umrechnen fÃŒr Standardland			
-			if ($this->get_option('wpsg_preisangaben') == WPSG_NETTO)			
-			{
-				
-				// Preis im Backend ist in Netto				
+			$produkt['mwst_value'] = $this->getCalcTaxValue($produkt['mwst_key']);
+
+			// Preis umrechnen fÃŒr Standardland
+			if ($this->get_option('wpsg_preisangaben') == WPSG_NETTO)
+			{
+
+				// Preis im Backend ist in Netto
 				$produkt['preis_netto'] = $produkt['preis'];
 				$produkt['preis_brutto'] = wpsg_calculatePreis($produkt['preis'], WPSG_BRUTTO, $produkt['mwst_value']);
-								
-			}
-			else 
-			{
-				 
+
+			}
+			else
+			{
+
 				// Preis im Backend ist in Brutto
 				$produkt['preis_brutto'] = $produkt['preis'];
 				$produkt['preis_netto'] = wpsg_calculatePreis($produkt['preis'], WPSG_NETTO, $produkt['mwst_value']);
-									 
-			}
-			
+
+			}
+
 			$produkt['tax_defaultLand'] = $produkt['mwst_value'];
 			$produkt['preis_defaultLand_brutto'] = $produkt['preis_brutto'];
 			$produkt['preis_defaultLand_netto'] = $produkt['preis_netto'];
-						
+
 			// Jetzt habe ich Netto/Brutto Werte im Standardland
 			// Wenn es jetzt ein Leistungsort Produkt ist, dann muss ich die Steuer des Ziellandes bestimmen
 			if (wpsg_isSizedInt($produkt['euleistungsortregel']) && $this->getDefaultCountry(true) != $this->getFrontendCountry(true))
 			{
-				
+
 				$oFrontendCountry = $this->getFrontendCountry();
-								
+
 				$produkt['mwst_value'] = $oFrontendCountry->getTax($produkt['mwst_key']);
 				$produkt['preis_brutto'] = wpsg_calculatePreis($produkt['preis_netto'], WPSG_BRUTTO, $produkt['mwst_value']);
-								
-			}
-			
+
+			}
+
 			if ($this->getFrontendTaxview() == WPSG_BRUTTO) $produkt['preis'] = $produkt['preis_brutto'];
 			else $produkt['preis'] = $produkt['preis_netto'];
-			
+
 			$produkt['min_preis'] = wpsg_tf($produkt['preis']);
 			$produkt['max_preis'] = wpsg_tf($produkt['preis']);
-			
+
 			if (get_option('wpsg_options_nl2br_out') == '1')
 			{
 
 				$produkt['beschreibung'] = nl2br($produkt['beschreibung']);
-				
-			}
-			
+
+			}
+
 			if (get_option('wpsg_options_no_rte_apply_filter') != '1')
 			{
-			
+
 				// Filter auf Beschreibung anwenden (RTE)
-				// Den wpsgContentFilter deaktivieren um rekursion zu vermeiden									
+				// Den wpsgContentFilter deaktivieren um rekursion zu vermeiden
 				remove_filter('the_content', array($GLOBALS['wpsg_sc'], 'content_filter'));
 				$produkt['beschreibung'] = apply_filters('the_content', $produkt['beschreibung']);
-				add_filter('the_content', array($GLOBALS['wpsg_sc'], 'content_filter'));	
-				
-			}  
-						
+				add_filter('the_content', array($GLOBALS['wpsg_sc'], 'content_filter'));
+
+			}
+
 			global $wp_rewrite;
 
@@ -1625,28 +1628,28 @@
 
 				$produkt['url'] = $this->getProduktLink($produkt['id']);
-				
-			}
-			
+
+			}
+
 			if ($this->hasMod('wpsg_mod_weight'))
 			{
-				
+
 				$produkt['min_weight'] = wpsg_tf($produkt['weight']);
 				$produkt['max_weight'] = wpsg_tf($produkt['weight']);
-				
+
 			}
 
 			// Artikelnummer
 			$produkt['anr'] = $this->getProductAnr($produkt['id']);
-			
+
 			$this->callMods('loadProduktArray', array(&$produkt));
-			
+
 			if ($produkt['preis'] < 0) $produkt['preis'] = 0;
 			if ($produkt['preis_brutto'] < 0) $produkt['preis_brutto'] = 0;
 			if ($produkt['preis_netto'] < 0) $produkt['preis_netto'] = 0;
-		 		 
+
 			return $produkt;
-			
+
 		} // public function loadProduktArray($produkt_id)
-		
+
 		/**
 		 * Gibt den Index aus einer Globalen zurÃŒck um sicherzustellen das JS Variablen nicht ÃŒberschrieben werden
@@ -1655,9 +1658,9 @@
 		public function getTemplateIndex()
 		{
-			
+
 			return $GLOBALS['wpsg_produkt_index'];
-			
+
 		} // public function getTemplateIndex()
-		  				
+
 		/**
 		 * LÃ€dt die verfÃŒgbaren Produkttemplates
@@ -1665,7 +1668,7 @@
 		public function loadProduktTemplates($key = false)
 		{
-			
+
 			$arTemplates = array();
-			
+
 			$handle = @opendir(WPSG_PATH_PRODUKTTEMPLATES);
 			if ($handle) { while ($file = readdir($handle))
@@ -1684,5 +1687,5 @@
 			} }
 			@closedir($handle);
-			
+
 			$handle = @opendir(WPSG_PATH_PRODUKTTEMPLATES_UV);
 			if ($handle) { while ($file = readdir($handle))
@@ -1701,5 +1704,5 @@
 			} }
 			@closedir($handle);
-			
+
 			$handle = @opendir(WPSG_PATH_PRODUKTTEMPLATES_UV_OLD);
 			if ($handle) { while ($file = readdir($handle))
@@ -1718,5 +1721,5 @@
 			} }
 			@closedir($handle);
-			 
+
 			$handle = @opendir(WPSG_PATH_PRODUKTTEMPLATES_TV);
 			if ($handle) { while ($file = readdir($handle))
@@ -1735,9 +1738,9 @@
 			} }
 			@closedir($handle);
-			
+
 			return $arTemplates;
-			
+
 		} // public function loadProduktTemplates()
-		
+
 		/**
 		 * Gibt die Produkt Artikelnummer fÃŒr ein Produkt anhand des ProduktschlÃŒssels zurÃŒck
@@ -1745,9 +1748,9 @@
 		public function getProductAnr($product_key)
 		{
-			
+
 			$anr = false;
-			
+
 			$return = $this->callMods('getProductAnr', array($product_key, &$anr));
-			
+
 			if ($anr === false)
 			{
@@ -1755,17 +1758,17 @@
 				// Kein Modul hat die Erstellung der Produktartikelnummer ÃŒbernommen
 				$product_data = $this->cache->loadProduct( $this->getProduktID($product_key));
-				
+
 				return $product_data['anr'];
-				
-			}			
-			else 
+
+			}
+			else
 			{
 
 				return $anr;
-				
-			}
-			
+
+			}
+
 		} // public function getProductAnr($product_key)
-		
+
 		/**
 		 * Gibt den Link zu einem Produkt zurÃŒck wenn mÃ¶glich
@@ -1774,23 +1777,23 @@
 		public function getProduktLink($basket_data)
 		{
-						
+
 			if (wpsg_isSizedInt($basket_data)) $product_id = $basket_data;
 			else if (isset($basket_data['product_id'])) $product_id = $basket_data['product_id'];
 			else if (wpsg_isSizedString($basket_data)) $product_id = $this->getProduktID($basket_data);
 			else $product_id = $this->getProduktID($basket_data['id']);
-			
+
 			$url = false;
 			$this->callMods('getProduktlink', array($product_id, &$url));
-			
+
 			if ($url === false)
 			{
-								
+
 				$produkt_data = $this->cache->loadProduct($product_id);
-				
+
 				if ($produkt_data['partikel'] > 0)
-				{		
-			
+				{
+
 					return get_permalink($produkt_data['partikel']);
-					
+
 				}
 				else if (isset($basket_data['referer']) && $basket_data['referer'] != '')
@@ -1798,46 +1801,46 @@
 
 					return $basket_data['referer'];
-					
+
 				}
 				else
 				{
-					
-					
+
+
 					//wpsg_debug("=".apply_filters( 'wpml_current_language', NULL ));
 					//do_action('wpml_switch_language', string $language_code )
-							
+
 					// FÃŒr das Bakend der Produktverwaltung, dass die Links auf die entsprechende Sprache gestellt werden
 					if (function_exists('icl_object_id'))
 					{
-					
-						if (wpsg_isSizedString($_REQUEST['wpsg_lang'])) 
-						{ 
-						
+
+						if (wpsg_isSizedString($_REQUEST['wpsg_lang']))
+						{
+
 							$lang_reset = apply_filters('wpml_current_language', null);
-							do_action('wpml_switch_language', $_REQUEST['wpsg_lang']); 
-					
+							do_action('wpml_switch_language', $_REQUEST['wpsg_lang']);
+
 						}
 						else
 						{
-							
+
 							$lang_reset = apply_filters('wpml_current_language', null);
 							do_action('wpml_switch_language', $this->getDefaultLanguageCode());
-							
+
 						}
-						
-					}
-						
+
+					}
+
 					if ($this->get_option('wpsg_page_product') > 0)
 						$product_url = $this->getURL(wpsg_ShopController::URL_PRODUCTDETAIL);
 					else
 						$product_url = $this->getURL(wpsg_ShopController::URL_BASKET);
-					
+
 					if (function_exists('icl_object_id') && isset($lang_reset))
 					{
-						
+
 						do_action('wpml_switch_language', $lang_reset);
-						
-					}
-					
+
+					}
+
 					if (strpos($product_url, "?") > 0)
 					{
@@ -1848,19 +1851,19 @@
 						$product_url .= "?wpsg_action=showProdukt&produkt_id=".$product_id;
 					}
-					
+
 					return $product_url;
-					
-				}
-				
+
+				}
+
 			}
 			else
 			{
-				
+
 				return $url;
-				
-			}
-			
+
+			}
+
 		} // public function getProduktLink($produkt_id)
-		
+
 		/**
 		 * Gibt die ID des Produkts zurÃŒck
@@ -1869,11 +1872,11 @@
 		public function getProduktID($produkt_key)
 		{
-						
+
 			if (is_numeric($produkt_key)) return $produkt_key;
-			else if (preg_match('/pv_(.*)/', $produkt_key)) 
-			{				
+			else if (preg_match('/pv_(.*)/', $produkt_key))
+			{
 				return preg_replace('/(pv_)|(\|(.*))/', '', $produkt_key);
 			}
-			else if (preg_match('/vp_(.*)/', $produkt_key)) 
+			else if (preg_match('/vp_(.*)/', $produkt_key))
 			{
 				return preg_replace('/(vp_)|(\/(.*))/', '', $produkt_key);
@@ -1881,19 +1884,19 @@
 			else if (preg_match('/abo_\d+_\d+/', $produkt_key))
 			{
-				
-				$arData = explode('_', $produkt_key);				
-				return $this->getProduktID($arData[2]);				
-				
+
+				$arData = explode('_', $produkt_key);
+				return $this->getProduktID($arData[2]);
+
 			}
 			else
 			{
-				
-				throw new \wpsg\Exception(_('Produkt ID konnte nicht gebildet werden.'), \wpsg\Exception::TYP_UNEXPECTED);				
+
+				throw new \wpsg\Exception(_('Produkt ID konnte nicht gebildet werden.'), \wpsg\Exception::TYP_UNEXPECTED);
 				return 0;
-				
-			}
-			
+
+			}
+
 		} // public function getProduktID($produkt_key)
-		
+
 		/**
 		 * Gibt alle Produkte des Shops zurÃŒck und beachtet die Ãbersetzung
@@ -1902,5 +1905,5 @@
 		public function getAllProductsForSelect()
 		{
-			 
+
 			$arProducts = $this->db->fetchAssocField("
 				SELECT
@@ -1910,30 +1913,30 @@
 				WHERE
 					P.`deleted` != '1' AND
-					P.`lang_parent` = '0'		
+					P.`lang_parent` = '0'
 			", "id", "name");
-			
+
 			if ($this->isOtherLang())
 			{
-												
+
 				foreach ($arProducts as $product_id => $product_name)
 				{
-					
+
 					$product_trans_name = $this->db->fetchOne("SELECT `name` FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($product_id)."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
-					
+
 					if (wpsg_isSizedString($product_trans_name))
 					{
-						
+
 						$arProducts[$product_id] = $product_trans_name;
-						
-					}
-					
-				}
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			return $arProducts;
-			
+
 		} // public function getAllProductsForSelect()
-		
+
 		/**
 		 * Setzt den Status einer Bestellung
@@ -1944,28 +1947,28 @@
 		public function setOrderStatus($order_id, $status_id, $inform)
 		{
-			
+
 			// Muss vor der Mailsache aufgerufen werden da sonst die Felder der Bestellung nicht gesetzt sind (Paketverfolgung)
 			// Die Bestellung darf auch noch nicht geladen sein, sonst wird das Objekt aus dem Cache genommen
 			$this->callMods('setOrderStatus', array($order_id, $status_id, $inform));
-			
+
 			$this->cache->clearOrderCache($order_id);
 			$this->view['order'] = $this->cache->loadOrder($order_id);
-						
+
 			if (trim($this->view['order']['language']) != '')
 			{
-				
+
 				// Die Bestellung wurde in einer anderen Sprache durchgefÃŒhrt, hier wechsel ich auf die wÃ€hrend der Bestellung gesetzte Sprach
 				$this->setTempLocale($this->view['order']['language']);
-					
-			} 
-			
+
+			}
+
 			// Keine Ãnderung, dann abbrechen
 			if ($this->view['order']['status'] == $status_id) return false;
-			
+
 			if ($status_id == 100)
 			{
-				
+
 				// Bestellung wechselt auf Zahlungakzeptiert
-				
+
 				// URL Benachrichtigung bei Zahlung ?
 				$arProdukts = $this->db->fetchAssoc("
@@ -1973,27 +1976,27 @@
 						P.`id`, OP.`menge`, OP.`mod_vp_varkey`, P.`posturl`, P.`posturl_bezahlung`, OP.`product_index`
 					FROM
-						`".WPSG_TBL_ORDERPRODUCT."` AS OP 
+						`".WPSG_TBL_ORDERPRODUCT."` AS OP
 							LEFT JOIN `".WPSG_TBL_PRODUCTS."` AS P ON (P.`id` = OP.`p_id`)
 					WHERE
-						OP.`o_id` = '".wpsg_q($order_id)."' 	
+						OP.`o_id` = '".wpsg_q($order_id)."'
 				");
-				
+
 				foreach ($arProdukts as $p)
 				{
-					
+
 					if ($p['posturl'] != '' && $p['posturl_bezahlung'] == '1')
 					{
-						
+
 						if ($p['mod_vp_varkey'] != '') $produkt_id = $p['mod_vp_varkey'];
 						else $produkt_id = $p['id'];
-						
+
 						$this->notifyURL($p['posturl'], $produkt_id, $p['menge'], $order_id, 1, false, array(
 							'product_index' => $p['product_index']
 						));
-						
-					}
-					
-				}
-				
+
+					}
+
+				}
+
 				// Datum Zahlungseingang setzen
 				$arrUpdate = array(
@@ -2001,31 +2004,31 @@
 				);
 				$this->db->updateQuery(WPSG_TBL_ORDER, $arrUpdate, "`id` = '".$order_id."'");
-				
-			}
-			
+
+			}
+
 			$status_alt = __($this->arStatus[$this->view['order']['status']], 'wpsg');
 			$status_neu = __($this->arStatus[$status_id], 'wpsg');
-						
+
 			if ($inform)
 			{
-							
+
 				$this->view['kunde'] = $this->cache->loadKunden($this->view['order']['k_id']);
-				
+
 				$this->view['status_alt'] = $this->arStatus[$this->view['order']['status']];
 				$this->view['status_neu'] = $this->arStatus[$status_id];
-				
+
 				if ($this->get_option('wpsg_htmlmail') === '1')
 				{
-						
+
 					$mail_html = $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/status.phtml', false);
-				
+
 				}
 				else
 				{
-						
+
 					$mail_html = false;
-				
-				}
-				
+
+				}
+
 				$mail_text = $this->render(WPSG_PATH_VIEW.'/mailtemplates/status.phtml', false);
 
@@ -2037,11 +2040,11 @@
 					"mailtext" => $mail_text
 				));
-				
+
 				$this->sendMail($mail_text, $this->view['kunde']['email'], 'status', array(), $order_id, false, $mail_html);
-				
+
 			}
 			else
 			{
-								
+
 				// Ins Protokoll eintragen
 				$this->db->ImportQuery(WPSG_TBL_OL, array(
@@ -2051,17 +2054,17 @@
 					'mailtext' => __('Kunde wurde nicht informiert', 'wpsg')
 				));
-				
-			}
-			
+
+			}
+
 			$this->db->UpdateQuery(WPSG_TBL_ORDER, array(
 				'status' => wpsg_q($status_id)
 			), "`id` = '".wpsg_q($order_id)."'");
-			
+
 			$this->restoreTempLocale();
-			
+
 			return true;
-			
+
 		} // public function setOrderStatus($order_id, $status_id, $inform)
-				 		 
+
 		/**
 		 * Gibt den Link zur Seite nach der Bestellung zurâÂºck
@@ -2071,20 +2074,20 @@
 
 			$basket_url = $this->getURL(wpsg_ShopController::URL_BASKET);
-			
+
 			if (strpos($basket_url, '?') === false)
 			{
-				
+
 				return $basket_url.'?order_id='.$order_id.'&wpsg_done='.preg_replace('/(\+)|(\=)/', 'A', base64_encode(md5('wpShopGermany'.$order_id, $this->get_option("wpsg_salt"))));
-				
+
 			}
 			else
 			{
-				
-				return $basket_url.'&order_id='.$order_id.'&wpsg_done='.preg_replace('/(\+)|(\=)/', 'A', base64_encode(md5('wpShopGermany'.$order_id, $this->get_option("wpsg_salt"))));	
-				
-			}
-			
+
+				return $basket_url.'&order_id='.$order_id.'&wpsg_done='.preg_replace('/(\+)|(\=)/', 'A', base64_encode(md5('wpShopGermany'.$order_id, $this->get_option("wpsg_salt"))));
+
+			}
+
 		} // public function getDoneURL($order_id)
-		
+
 		/**
 		 * Gibt die URL zum lÃ¶schen eines Produktes zurâÂºck
@@ -2092,22 +2095,22 @@
 		public function getRemoveLinkURL($produkt_key)
 		{
-			
+
 			$basket_url = $this->getURL(wpsg_ShopController::URL_BASKET);
-			
+
 			if (strpos($basket_url, '?') === false)
 			{
-				
+
 				return $basket_url.'?wpsg_action=remove&wpsg_produkt='.$produkt_key;
-				
+
 			}
 			else
 			{
-				
+
 				return $basket_url.'&wpsg_action=remove&wpsg_produkt='.$produkt_key;
-				
-			}
-			
+
+			}
+
 		} // public function getRemoveLinkURL($produkt_key)
-		
+
 		/**
 		 * PrÃŒft ob das Modul aktiv ist
@@ -2115,9 +2118,9 @@
 		public function hasMod($mod_name)
 		{
-		 			
+
 			return array_key_exists($mod_name, $this->arModule);
-			
+
 		} // public function hasMod($mod_name)
-		
+
 		/**
 		 * PrÃŒft ob ein Modul eine Funktion implementiert
@@ -2125,11 +2128,11 @@
 		public function hasModulFunction($mod_name, $function_name)
 		{
-			
+
 			if (!$this->hasMod($mod_name)) return false;
-			
+
 			return method_exists($this->arModule[$mod_name], $function_name);
-						
+
 		} // public function hasModulFunction($mod, $function)
-		
+
 		/**
 		 * LÃ€dt die Module
@@ -2137,86 +2140,86 @@
 		public function loadModule($all = false)
 		{
-		
+
 			$this->arModule = array();
 			$this->arAllModule = array();
-			
+
 			if (file_exists(WPSG_PATH_MOD.'wpsg_mod_core.class.php'))
 			{
-				
+
 				require_once WPSG_PATH_MOD.'wpsg_mod_core.class.php';
-				
+
 				$mod = new wpsg_mod_core();
-				
+
 				return $mod->loadModule($all);
-				
-			}
-			else 
-			{
-				 
+
+			}
+			else
+			{
+
 				$mod_dir = opendir(WPSG_PATH_MOD);
-					
+
 				$global = false;
 				if ($this->isMultiBlog() && $this->get_option('wpsg_multiblog_standalone', true) != '1') $global = true;
-					
+
 				while ($file = readdir($mod_dir))
 				{
-				
+
 					if (!is_dir(WPSG_PATH_MOD."/".$file) && $file != "." && $file != ".." && preg_match("/(.*)\.class\.php/i", $file) && $file != "wpsg_mod_basic.class.php")
 					{
-							
+
 						if (file_exists(WPSG_PATH_USERMOD.$file)) require_once(WPSG_PATH_USERMOD.$file);
 						else require_once(WPSG_PATH_MOD.$file);
-							
+
 						$class_name = preg_replace("/\.class\.php/", "", $file);
-							
+
 						$mod = new $class_name();
-							
+
 						// Demo oder Modul fÃŒr Lizenz aktiv
 						if (!isset($mod->version) && 1 >= $mod->lizenz)
 						{
-				
+
 							if ($this->get_option($class_name, $global) > 0)
 							{
-				
+
 								$this->arModule[$class_name] = $mod;
-				
+
 							}
-							
+
 							if ($all)
 							{
-							
+
 								$this->arAllModule[$class_name] = $mod;
-							
+
 							}
-				
+
 						}
-					
-					}
-				
-				}
-					
+
+					}
+
+				}
+
 				uasort($this->arModule, array($this, "cmp_mods"));
-					
+
 				if ($all) uasort($this->arAllModule, array($this, "cmp_mods"));
-				
+
 				// Module werden hier erst initiiert, da dann alle Module bekannt sind und die Reihenfolge hergestellt ist
 				foreach ($this->arModule as $mod_key => $m)
 				{
-				
+
 					if ($this->get_option(get_class($m), $global) > 0)
 					{
-				
+
 						$m->init();
-							
-					}
-				
-				}
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			return;
-			
+
 		} // public function loadModule($all = false)
-		
+
 		/**
 		 * Gibt die Tage der DemoVersion zurÃŒck
@@ -2224,8 +2227,8 @@
 		public function getDemoDays()
 		{
-			
+
 			if ($this->hasMod('wpsg_mod_core')) return $this->callMod('wpsg_mod_core', 'getDemoDays');
 			else return 0; /* Free Version benÃ¶tigt keine Demoversion */
-						
+
 		} // public function getDemoDays()
 
@@ -2234,19 +2237,19 @@
 		 */
 		public function hasActiveLicence()
-		{  
+		{
 
 			if ($this->hasMod('wpsg_mod_core'))
 			{
-				
+
 				return $this->callMod('wpsg_mod_core', 'hasActiveLicence');
-				
+
 			}
 			else
 			{
-				
+
 				return true;
-				
-			}
-			
+
+			}
+
 		} // public function hasActiveLicence()
 
@@ -2257,17 +2260,17 @@
 		public function getPagePID($page_const)
 		{
-			
+
 			switch ($page_const)
 			{
-				
+
 				case self::PAGE_BASKET: return $this->getPageId($this->get_option('wpsg_page_basket'));
 				case self::URL_PRODUCTDETAIL: return $this->getPageId($this->get_option('wpsg_page_product'));
-				
-			}
-			
+
+			}
+
 			throw new \wpsg\Exception(__('UngÃŒltige Seite'));
-			
+
 		}
-		
+
 		/**
 		 * Wie get_the_id() gibt aber bei WPML und ÃŒbersetzten Seiten die ID der Originalseite zurÃŒck
@@ -2275,14 +2278,14 @@
 		public function getPageId($page_id)
 		{
-			
+
 			if (function_exists('icl_object_id')) //is_plugin_active('sitepress-multilingual-cms/sitepress.php'))
 			{
-				
+
 				return icl_object_id($page_id, 'page', true);
-				
+
 			} else return $page_id;
-			
+
 		} // public function get_the_id()
-		
+
 		/**
 		 * Gibt false oder die ID des ÃŒbersetzten "Produkts" in der Produkttabelle zurÃŒck
@@ -2290,20 +2293,20 @@
 		public function getTranslationID($product_id, $lang)
 		{
-			
+
 			if (!array_key_exists($product_id, $this->_arProductTranslationIDs))
 			{
-				
+
 				$trans_id = $this->_db->fetchOne("SELECT P.`id` FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($product_id)."' AND `lang_code` = '".wpsg_q($lang)."'");
-								
+
 				if ($trans_id <= 0) return false;
-				
+
 				$this->_arProductTranslationIDs[$product_id] = $trans_id;
-				
-			}
-			
+
+			}
+
 			return $this->_arProductTranslationIDs[$product_id];
-			
+
 		} // public function getTranslationID($product_id, $lang)
-		 		
+
 		/**
 		 * Gibt true zurÃŒck, sollte die aktive Sprache nicht die Aktuelle Sprache sein
@@ -2311,5 +2314,5 @@
 		public function isOtherLang()
 		{
-			
+
 			global $q_config;
 
@@ -2327,5 +2330,5 @@
 
 				// qTranslate
-			
+
 				$arLocales = $q_config['locale'];
 				$qtDefault = $q_config['default_language'];
@@ -2339,25 +2342,25 @@
 
 			}
-			
+
 			return false;
-			
+
 		} // public function isOtherLang()
-		
+
 		public function getLocaleToLanguageCode($code)
 		{
-			
+
 			$arLang = $this->getStoreLanguages();
-			
+
 			foreach ($arLang as $lang)
 			{
-				
+
 				if ($lang['lang'] == $code) return $lang['locale'];
-				
-			}
-			
+
+			}
+
 			return false;
-			
+
 		}
-		
+
 		/**
 		 * Gibt true zurÃŒck wenn mehrere Sprachen im System verwendet werden
@@ -2365,11 +2368,11 @@
 		public function isMultiLingual()
 		{
-			
+
 			$arLang = $this->getStoreLanguages();
-			
+
 			return (sizeof($arLang) > 0);
-			
+
 		} // public function isMultiLingual()
-		
+
 		/**
 		 * Gibt einen Array mit allen im Shop verwendeten Sprachen zurÃŒck
@@ -2377,7 +2380,7 @@
 		public function getStoreLanguages()
 		{
-			
-			global $q_config; 
-			
+
+			global $q_config;
+
 			$arLang = array();
 
@@ -2388,5 +2391,5 @@
 
 				$languages = apply_filters('wpml_active_languages', NULL, 'orderby=id&order=desc&skip_missing=0');
- 
+
 				foreach ($languages as $l)
 				{
@@ -2433,7 +2436,7 @@
 
 			return $arLang;
-			
+
 		} // public function getStoreLanguages()
-		 				
+
 		/**
 		 * PrÃŒft die Einstellungen und setzt sie ggf. auf einen Standardwert
@@ -2441,21 +2444,21 @@
 		public function checkDefault($name, $value, $force_global = false, $translation = false)
 		{
-			
+
 			if ($this->get_option($name, $force_global) === false)
 			{
-				
+
 				$this->update_option($name, $value, $force_global);
-				
+
 				if ($translation === true)
 				{
-					
+
 					$this->addTranslationString($name, $value);
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 		} // public function checkDefault($name, $value)
-		
+
 		/**
 		 * Sortier Hilfsfunktion fÃŒr die Module
@@ -2463,11 +2466,11 @@
 		public static function cmp_mods($mod1, $mod2)
 		{
-			
+
 			if ((int)$mod1->id == (int)$mod2->id) return 0;
     		if ((int)$mod1->id > (int)$mod2->id) return 1;
     		if ((int)$mod1->id < (int)$mod2->id) return -1;
-			
+
 		} // private function cmp_mods($mod1, $mod2)
-		
+
 		/**
 		 * Sortiert zwei Module nach dem Namen
@@ -2475,17 +2478,17 @@
 		public static function cmp_mods_name($mod1, $mod2)
 		{
-			
+
 			if ($mod1->name == $mod2->name) return 0;
 			if ($mod1->name > $mod2->name) return 1;
 			if ($mod1->name < $mod2->name) return -1;
-			
+
 		} // public static function cmp_mods_name($mod1, $mod2)
-		 
+
 		/**
 		 * Generiert einen Code gibt ihn zurÃŒck
 		 */
 		public function getCode($length = 8)
-		{ 
-			
+		{
+
 			$pool = "qwertzupasdfghkyxcvbnm";
 			$pool .= "23456789";
@@ -2500,9 +2503,9 @@
 
 			}
-			
+
     		return $passw;
-    		
+
 		} // public function getCode($length = 8)
-		
+
 		/**
 		 * Excerpt filtern
@@ -2510,11 +2513,11 @@
 		public function the_excerpt($content)
 		{
-			
+
 			$this->callMods('the_excerpt', array(&$content));
-			
+
 			return $content;
-			
+
 		}
-		
+
 		/**
 		 * Ausgabe im Frontend
@@ -2536,40 +2539,40 @@
 
 				$this->callMod($_REQUEST['wpsg_mod'], $_REQUEST['wpsg_action'].'Action', array(&$out_content));
-				
+
 			}
 			else
 			{
-			
+
 				$bRenderModul = $this->callMods('content_filter', array(&$out_content));
-			
+
 				// Nur wenn kein Modul die Ausgabe ÃŒbernommen hat
 				if ($bRenderModul === true) $this->basketController->content_filter($out_content);
-			
-			}
-				
+
+			}
+
 			if ($this->get_option('wpsg_content_filter_direct') == '1')
 			{
-				
+
 				echo $out_content;
-				
-			} 
-			
+
+			}
+
 			if ($out_content != $content)
 			{
-				
+
 				// wpShopGermany hat die Inhaltsausgabe manipuliert
 				if (wpsg_isSizedInt($this->get_option('wpsg_nocache')))
 				{
-					
+
 					if (!defined('DONOTCACHEPAGE')) define('DONOTCACHEPAGE',true);
-					
-				}
-				
-			}
-												
+
+				}
+
+			}
+
 			return $out_content;
-			 			
+
 		} // public function content_filter()
-		
+
 		/**
 		 * Wordpress HOOK vor AusfÃŒhrung des Querys
@@ -2578,9 +2581,9 @@
 		public function pre_get_posts(&$query)
 		{
-			
+
 			$this->callMods('pre_get_posts', array(&$query));
-			
+
 		} // public function pre_get_posts($query)
-		
+
 		/**
 		 * LÃ€dt die Zahlungs- und Versandmethoden in den Shop Array
@@ -2588,10 +2591,10 @@
 		public function addShipPay()
 		{
-			
+
 			$this->callMods('addShipping', array(&$this->arShipping));
 			$this->callMods('addPayment', array(&$this->arPayment));
-			
+
 		} // public function addShipPay()
-		
+
 		/**
 		 * Im Prinzip wie wp_loaded nur das get_permalink schon funktioniert
@@ -2599,5 +2602,5 @@
 		public function template_redirect()
 		{
-				
+
 			$this->checkEscape();
 
@@ -2605,149 +2608,149 @@
 			if (isset($_REQUEST['wpsg']['checkout']['shipping_land'])) $_SESSION['wpsg']['checkout']['shipping_land'] = $_REQUEST['wpsg']['checkout']['shipping_land'];
 			if (isset($_REQUEST['wpsg']['checkout']['land'])) $_SESSION['wpsg']['checkout']['land'] = $_REQUEST['wpsg']['checkout']['land'];
-					
+
 			if (!is_admin())
 			{
-			
+
 			$this->basket->initFromSession();
-			
+
 			$this->addShipPay();
-			
-			}
-						
+
+			}
+
 			if (!is_admin())
 			{
-								 				
+
 				// Sollte die Session noch nicht mit Werten gefÃŒllt sein dann hier die Kundenvoreinstellungen laden
 				$this->checkCustomerPreset();
-				
+
 				// Modulverarbeitung
 				$this->callMods('template_redirect');
-				 
+
 				if (wpsg_isSizedString($_REQUEST['wpsg_mod']) && wpsg_isSizedString($_REQUEST['wpsg_action']))
 				{
-				
+
 					if ($this->hasModulFunction($_REQUEST['wpsg_mod'], $_REQUEST['wpsg_action'].'Redirect'))
 					{
-					
+
 						$this->callMod($_REQUEST['wpsg_mod'], $_REQUEST['wpsg_action'].'Redirect'); return;
-										
-					}
-					
-				}
-				
+
+					}
+
+				}
+
 				// Verarbeitung im BasketController
  				$this->basketController->template_redirect();
-			
+
 				// Wenn Checkout abgeschickt wurde, dann Bestellung speichern
 				if (wpsg_isSizedArray($_REQUEST['wpsg']['checkout'])) $this->basket->save(false);
-				
+
 				$this->basket->save(false);
-				
-				}
-			
+
+				}
+
 		} // public function template_redirect()
-		
+
 		public function wp_load()
 		{
-			
+
 			if (is_admin()) $this->addShipPay();
-			
+
 			load_plugin_textdomain('wpsg', false, dirname( plugin_basename( __FILE__ ) ).'/../lang/');
-			   
+
 		} // public function wp_load()
-		 		
+
 		/**
 		 * Sendet eine Mail
-		 * Sind $o_id order $k_id nicht false, so wird der Betreff und der Text durch die ShopErsetzungsfunktion gejagt 
+		 * Sind $o_id order $k_id nicht false, so wird der Betreff und der Text durch die ShopErsetzungsfunktion gejagt
 		 */
 		public function sendMail(&$mail_text, $empfaenger, $mail_key, $anhang = array(), $o_id = false, $k_id = false, $mail_html = false, $force_subject = false)
 		{
-			
+
 			add_filter('wp_mail_content_type', 'wpsg_mail_content_type', 10, 2);
-			
+
 			if (wpsg_isSizedString($force_subject)) $subject = $force_subject;
 			else $subject = $this->getMailValue('wpsg_'.$mail_key.'_betreff');
-			
+
 			$from = $this->getMailValue('wpsg_'.$mail_key.'_absender');
 			$cc = $this->getMailValue('wpsg_'.$mail_key.'_cc');
 			$bcc = $this->getMailValue('wpsg_'.$mail_key.'_bcc');
-			
-			$subject = $this->replaceUniversalPlatzhalter($subject, $o_id, $k_id);			
+
+			$subject = $this->replaceUniversalPlatzhalter($subject, $o_id, $k_id);
 			$mail_text = $this->replaceUniversalPlatzhalter($mail_text, $o_id, $k_id);
 			$mail_html = $this->replaceUniversalPlatzhalter($mail_html, $o_id, $k_id);
-			
+
 			$headers = array();
-			
-			if ($from != '') 
-			{
-			 
-				$headers['from'] = 'FROM:'.$from; 
+
+			if ($from != '')
+			{
+
+				$headers['from'] = 'FROM:'.$from;
 				$headers['rp'] = 'Return-Path:'.preg_replace('/(.*)\</', '<', $from);
-				
-			} 
-			
+
+			}
+
 			if ($cc != '') $headers['cc'] = 'CC:'.$cc;
 			if ($bcc != '') $headers['bcc'] = 'BCC:'.$bcc;
-			
+
 			// Werbetext / Impressum etc.
 			$addText = $this->replaceUniversalPlatzhalter($this->getMailValue('wpsg_'.$mail_key.'_text'), $o_id, $k_id);
 			if (wpsg_isSizedString($addText))
 			{
-					
+
 				if (wpsg_isSizedString($mail_html)) $mail_html .= nl2br($addText);
-					
+
 				$mail_text .= strip_tags($addText);
-					
-			}
-				 
+
+			}
+
 			if (wpsg_isSizedString($mail_html))
 			{
-			
+
 				$mail_head = $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/html_head.phtml', false);
 				$mail_foot = $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/html_foot.phtml', false);
-				
+
 				$mail_html = $mail_head.$mail_html.$mail_foot;
-				
-			}
-						
+
+			}
+
 			// Branding
 			if (!$this->hasMod('wpsg_mod_core') || @$this->arLizenz['l'] < 3)
 			{
-				
+
 				$mail_text .= base64_decode('IAotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgpWZXJ3ZW5kZXRlIFNob3AgU29mdHdhcmU6IHdwU2hvcEdlcm1hbnkgKGh0dHA6Ly93cHNob3BnZXJtYW55Lm1hZW5uY2hlbjEuZGUp');
-				
-				if (wpsg_isSizedString($mail_html))					
-				{
-				
+
+				if (wpsg_isSizedString($mail_html))
+				{
+
 					$mail_html = preg_replace('/\<\/body\>/', base64_decode('PGJyIC8+DQo8ZGl2IHN0eWxlPSJib3JkZXItdG9wOjFweCBzb2xpZCAjMDAwMDAwOyB3aWR0aDoxMDAlOyBib3R0b206MHB4OyAgdGV4dC1hbGlnbjpjZW50ZXI7IGJhY2tncm91bmQtY29sb3I6I0YxRURFRDsgY29sb3I6MDAwMDAwIj48ZGl2IHN0eWxlPSJwYWRkaW5nOjVweDsiPg0KVmVyd2VuZGV0ZSBTaG9wIFNvZnR3YXJlOiA8YSBocmVmPSJodHRwOi8vd3BzaG9wZ2VybWFueS5kZSI+d3BTaG9wR2VybWFueTwvYT48L2Rpdj48L2Rpdj4=').'</body>', $mail_html);
-									
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			$mail_text_send = $mail_text;
-			
+
 			if ($this->get_option('wpsg_htmlmail') === '1')
 			{
-			
+
 				$this->text_message = $mail_text;
-				
+
 				if (wpsg_isSizedString($mail_html))
 				{
-					
+
 					$mail_text_send = $mail_html;
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			$this->callMods('sendMail', array($mail_key, $o_id, $k_id, &$empfaenger, &$subject, &$mail_text_send, &$headers, &$anhang));
-			 
+
 			wp_mail($empfaenger, $subject, $mail_text_send, $headers, $anhang);
-			
+
 			return array($subject, $mail_text);
-			
+
 		} // public function sendMail($mail_text, $mail_key)
-		 
+
 		/**
 		 * Gibt eine Konfiguration der E-Mail Konfiguration zurÃŒck
@@ -2756,22 +2759,22 @@
 		public function getMailValue($key)
 		{
-			
+
 			if ($this->get_option($key) === false || $this->get_option($key) == '')
 			{
-				
+
 				$key_global = preg_replace('/\_(.*)\_/', '_global_', $key);
-				
+
 				return __($this->get_option($key_global), 'wpsg');
-				
+
 			}
 			else
 			{
-				
+
 				return __($this->get_option($key), 'wpsg');
-				
-			}
-			
+
+			}
+
 		} // public function getMailValue($key)
-		
+
 		/**
 		 * Zeichnet die Kundenvariablen innerhalb des checkout2.phtml
@@ -2779,21 +2782,21 @@
 		public function renderKundenField(&$checkout_view, $kv_id)
 		{
-			
+
 			$arKV = $this->loadPflichtFeldDaten();
-		 
+
 			if (!is_array($arKV)) return;
-			
+
 			// GÃŒltige Kundenvariable?
 			if (!array_key_exists($kv_id, $arKV['custom'])) return;
-						
+
 			$this->view['error'] = $checkout_view['error'];
 			$this->view['basket'] = $checkout_view['basket'];
 			$this->view['field'] = $arKV['custom'][$kv_id];
 			$this->view['field']['id'] = $kv_id;
-			
+
 			$this->render(WPSG_PATH_VIEW.'/warenkorb/kundendaten_renderfield.phtml');
-			
+
 		} // public function renderKundenField()
-		
+
 		/**
 		 * Gibt den Basket aus der Session als Objekt zurÃŒck
@@ -2801,14 +2804,14 @@
 		public function getFullBasket()
 		{
-			 
+
 			$arBasket = array();
-			
+
 			// Session durchgehen
-			
-			
+
+
 			return $arBasket;
-			
+
 		} // public function getFullBasket()
-		
+
 		/**
 		 * Ersetzt in dem String $value die Platzhalter und gibt den neuen String zurÃŒck
@@ -2816,95 +2819,95 @@
 		public function replaceUniversalPlatzhalter($value, $order_id = false, $kunden_id = false, $rechnung_id = false, $product_id = false, $arCustomReplace = array(), $product_index = false)
 		{
-			
+
 			$arReplace = array();
-						
+
 			if ($order_id !== false)
 			{
-				
+
 				$order_data = $this->cache->loadOrder($order_id);
 
 				if (!wpsg_isSizedInt($kunden_id))
-				{	
+				{
 
 					$kunden_id = $order_data['k_id'];
-				
-				}
-				
+
+				}
+
 				foreach ((array)$order_data as $k => $v)
 				{
-					
+
 					if ($k == 'cdate')
 					{
-						
+
 						$arReplace['/%order_'.$k.'%/i'] = wpsg_fromDate($v);
-						
-					}
-					else 
-					{
-						
+
+					}
+					else
+					{
+
 						$arReplace['/%order_'.$k.'%/i'] = $v;
-						
-					}
-					
-				}
-
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			if (wpsg_isSizedInt($kunden_id))
 			{
 
 				$kunden_data = $this->cache->loadKunden($kunden_id);
-				
+
 				foreach ((array)$kunden_data as $k => $v)
 				{
-					
+
 					$arReplace['/%kunde_'.$k.'%/i'] = $v;
-					
-				}
-				
+
+				}
+
 				// Kundenvariablen
 				//wpsg_admin_pflicht
-				$arPflicht = $this->get_option('wpsg_admin_pflicht');				
+				$arPflicht = $this->get_option('wpsg_admin_pflicht');
 
 				if (wpsg_isSizedArray($arPflicht['custom']))
 				{
-				
+
 					foreach ($arPflicht['custom'] as $index => $kv)
 					{
-					 
+
 						$arReplace['/%kv_'.$index.'%/i'] = $this->getCustomFieldFromDB($kunden_id, $index);
-										
-					}
-					
-				}
-								
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			if ($product_id !== false && $product_id > 0)
 			{
 
 				$product_data = $this->cache->loadProduct($product_id);
-				
+
 				foreach ($product_data as $k => $v)
 				{
-					
+
 					$arReplace['/%product_'.$k.'%/'] = $v;
 					$arReplace['/%product_'.$k.'%/i'] = $v;
-					
-				}
-				
+
+				}
+
 				$arReplace['/%product_url/i'] = $this->getProduktLink($product_id);
-				
-			}
-			
+
+			}
+
 			if ($product_index !== false)
 			{
-				
+
 				$arReplace['/%product_index%/'] = $product_index;
-				
-			}
-						
+
+			}
+
 			$arReplace['/%rand%/'] = rand(0, 1000);
-			
+
 			$arReplace['/%a%/'] = strftime('%a');
 			$arReplace['/%A%/'] = strftime('%A');
@@ -2932,5 +2935,5 @@
 			$arReplace['/%T%/'] = strftime('%T');
 			$arReplace['/%u%/'] = strftime('%u');
-			$arReplace['/%U%/'] = strftime('%U');			
+			$arReplace['/%U%/'] = strftime('%U');
 			$arReplace['/%V%/'] = strftime('%V');
 			$arReplace['/%w%/'] = strftime('%w');
@@ -2939,14 +2942,14 @@
 			$arReplace['/%X%/'] = strftime('%X');
 			$arReplace['/%y%/'] = strftime('%y');
-			$arReplace['/%y1%/'] = strftime('%y', mktime(date('H'), date('i'), date('s'), date('n'), date('j'), date('Y') + 1)); 
-			$arReplace['/%Y%/'] = strftime('%Y');			
-			$arReplace['/%Y1%/'] = strftime('%Y', mktime(date('H'), date('i'), date('s'), date('n'), date('j'), date('Y') + 1));			
+			$arReplace['/%y1%/'] = strftime('%y', mktime(date('H'), date('i'), date('s'), date('n'), date('j'), date('Y') + 1));
+			$arReplace['/%Y%/'] = strftime('%Y');
+			$arReplace['/%Y1%/'] = strftime('%Y', mktime(date('H'), date('i'), date('s'), date('n'), date('j'), date('Y') + 1));
 			$arReplace['/%Z%/'] = strftime('%Z');
 
 			$arReplace['/%widerrufsformular_url%/i'] = WPSG_URL_UPLOADS.'wpsg_revocation/'.$this->get_option('wpsg_revocationform');
-			
+
 			$arReplace['/%anfrageliste_url%/i'] = $this->getURL(wpsg_ShopController::URL_REQUEST);
 			$arReplace['/%warenkorb_url%/i'] = $this->getURL(wpsg_ShopController::URL_BASKET);
-			$arReplace['/%versandkosten_url%/i'] = $this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN);			
+			$arReplace['/%versandkosten_url%/i'] = $this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN);
 			$arReplace['/%agb_url%/i'] = $this->getURL(wpsg_ShopController::URL_AGB);
 			$arReplace['/%datenschutz_url%/i'] = $this->getURL(wpsg_ShopController::URL_DATENSCHUTZ);
@@ -2955,8 +2958,8 @@
 			$arReplace['/%impressum_url%/i'] = $this->getURL(wpsg_ShopController::URL_IMPRESSUM);
 			$arReplace['/%profil_url%/i'] = $this->getURL(wpsg_ShopController::URL_PROFIL);
-			$arReplace['/%bestellungen_url%/i'] = $this->getURL(wpsg_ShopController::URL_ORDER);	
+			$arReplace['/%bestellungen_url%/i'] = $this->getURL(wpsg_ShopController::URL_ORDER);
 			$arReplace['/%logout_url%/i'] = $this->getURL(wpsg_ShopController::URL_LOGOUT);
 			$arReplace['/%passwortvergessen_url%/i'] = $this->getURL(wpsg_ShopController::URL_LOSTPWD);
-									
+
 			/* Shopinfo */
 			$arReplace['/%shopinfo_name%/i'] = $this->get_option('wpsg_shopdata_name');
@@ -2974,31 +2977,31 @@
 			$arReplace['/%shopinfo_iban%/i'] = $this->get_option('wpsg_shopdata_bank_iban');
 			$arReplace['/%shopinfo_bic%/i'] = $this->get_option('wpsg_shopdata_bank_bic');
-			
-			/* Platzhalter fÃŒr die Warenkorbdarstellung, da es recht aufwendig ist suche ich hier vorher nach dem Vorkommen */			
+
+			/* Platzhalter fÃŒr die Warenkorbdarstellung, da es recht aufwendig ist suche ich hier vorher nach dem Vorkommen */
 			if (strpos(strtolower($value), '%basket_html%') !== false) $arReplace['/%basket_html%/i'] = $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/order.phtml', false);
 			if (strpos(strtolower($value), '%basket_txt%') !== false) $arReplace['/%basket_txt%/i'] = $this->render(WPSG_PATH_VIEW.'/mailtemplates/order.phtml', false);
-			
-			$revocation_form = WPSG_PATH_UPLOADS.'wpsg_revocation/'.$this->get_option('wpsg_revocationform');			
+
+			$revocation_form = WPSG_PATH_UPLOADS.'wpsg_revocation/'.$this->get_option('wpsg_revocationform');
 			if (file_exists($revocation_form) && is_file($revocation_form)) $arReplace['/%widerrufformular_pdf_url%/i'] = WPSG_URL_UPLOADS.'wpsg_revocation/'.$this->get_option('wpsg_revocationform');
-			
+
 			$this->callMods('replaceUniversalPlatzhalter', array(&$arReplace, $order_id, $kunden_id, $rechnung_id, $product_id, $product_index));
-			
-			foreach ($arCustomReplace as $k => $v) { $arReplace[$k] = $v; } 
-			
+
+			foreach ($arCustomReplace as $k => $v) { $arReplace[$k] = $v; }
+
 			$value = preg_replace(array_keys($arReplace), array_values($arReplace), $value);
-			
-			// Sollte irgendein platzhalter mal nicht ersetzt werden denn clear ich das 
+
+			// Sollte irgendein platzhalter mal nicht ersetzt werden denn clear ich das
 			if (isset($this->noReplace) && $this->noReplace === true) return $value;
 			else
 			{
-				
+
 				$value = preg_replace('/%[A-Za-z][^(%|\040)]*%/', '', $value);
-			
+
 				return $value;
-				
-			}
-			
+
+			}
+
 		} // public function replaceUniversalPlatzhalter($value, $order_id = false, $kunden_id = false, $rechnung_id = false)
-		
+
 		/**
 		 * Gibt das Verzeichnis zurÃŒck, in dem der Shop temporÃ€re Daten ablegen kann
@@ -3006,28 +3009,28 @@
 		public function getTempDir($getUrl = false)
 		{
-			
+
 			$path = '';
-			
+
 			if ($this->isMultiBlog())
 			{
-				
+
 				$path = WPSG_PATH_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_temp/';
 				$url = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_temp/';
-				
+
 			}
 			else
 			{
-				
+
 				$path = WPSG_PATH_CONTENT.'uploads/wpsg_temp/';
 				$url = WPSG_URL_CONTENT.'uploads/wpsg_temp/';
-				
+
 			}
 
 			if (!file_exists($path)) wpsg_mkdir($path);
-			
+
 			if ($getUrl === true) return $url; else return $path;
-			
+
 		} // public function getTempDir()
-		
+
 		/**
 		 * Generiert eine TemporÃ€re Datei und gibt den Pfad dahingehend zurÃŒck
@@ -3035,46 +3038,46 @@
 		public function getTempName($filename = '')
 		{
-			
+
 			$path = $this->getTempDir();
 			$filename = trim(time().rand(0, 1000)).$filename;
-									
+
 			return $path.$filename;
-			
+
 		} // public function getTempName()
- 
+
 		/**
 		 * FÃŒhrt ein Kommando aus und gibt die Programmausgabe zurÃŒck
 		 */
-		function exec($cmd) 
-		{
-			
+		function exec($cmd)
+		{
+
             $back="";
-            
+
             $io = array();
-            
+
             $p = proc_open($cmd,
                            array(1 => array('pipe', 'w'),
                                  2 => array('pipe', 'w')),
                            $io);
- 
+
             while (!feof($io[1])) {
                 $back .= htmlspecialchars(fgets($io[1]),
                                                         ENT_COMPAT, 'UTF-8');
             }
-            
+
             while (!feof($io[2])) {
                 $back .= htmlspecialchars(fgets($io[2]),
                                                         ENT_COMPAT, 'UTF-8');
             }
- 
+
             fclose($io[1]);
             fclose($io[2]);
-            
+
             proc_close($p);
-            
+
             return $back;
-            
-		} // function exec($cmd) 
-		
+
+		} // function exec($cmd)
+
 		/**
 		 * FÃŒgt in die Dummy phtml ein zu ÃŒbersetzenden String hinzu
@@ -3082,122 +3085,122 @@
 		public function addTranslationString($key, $value)
 		{
-			
+
 			if (function_exists('icl_register_string'))
 			{
-				
+
 				// WPML Version
 				icl_register_string('wpsg', 'wpsg_auto_'.$key, $value, false, 'de');
-				
+
 			}
 			else
 			{
-			
-				try 
-				{
-			 
+
+				try
+				{
+
 					if (file_exists(WPSG_PATH_TRANSLATION))
 					{
-											
+
 						preg_match_all('/\$(.*)\040+\=\040+\_\_\(\'([^\']*)/i', file_get_contents(WPSG_PATH_TRANSLATION), $matches);
-						
+
 						if (@sizeof($matches[1]) != @sizeof($matches[2]))
 						{
-							
+
 							$this->addBackendError(__('Unerwarteter Fehler beim schreiben der Ãbersetzungsdatei.', 'wpsg'));
 							return;
-							
-						}					
-						
+
+						}
+
 						$bDrin = false;
 						foreach ($matches[1] as $k => $m)
 						{
-							
+
 							if ($matches[1][$k] == $key)
 							{
-								
+
 								$bDrin = true;
 								$matches[2][$k] = $value;
-								
+
 							}
-							
+
 						}
-						
+
 						if (!$bDrin)
 						{
-							
+
 							$matches[1][] = $key;
 							$matches[2][] = $value;
-							
+
 						}
-						
+
 						$strFile = '';
-						
+
 						foreach ($matches[1] as $k => $m)
 						{
-							
+
 							$strFile .= '$'.$matches[1][$k]." = __('".$matches[2][$k]."', 'wpsg');\r\n";
-							
+
 						}
-						
+
 						@file_put_contents(WPSG_PATH_TRANSLATION, "<?php die(); \r\n".$strFile."\r\n?>");
-						
+
 					}
 					else
 					{
-		
+
 						// Leere Datei erstellen
 						@file_put_contents(WPSG_PATH_TRANSLATION, "<?php die(); \r\n$".$key." = __('".$value."', 'wpsg'); \r\n?>");
-						
-					}
-					
+
+					}
+
 				}
 				catch (Exception $e)
 				{
-					
+
 					$this->addBackendError('nohspc_'.__('Sprachdatei konnte nicht geschrieben werden! Setzen Sie bitte Schreibrechte auf folgender Datei ÃŒberprÃŒfen:<br /><b>'.WPSG_PATH_TRANSLATION.'</b>', 'wpsg'));
-					
-				}
-				
-			}
-				
+
+				}
+
+			}
+
 		} // public function addTranslationString($key, $value)
-		
-		/**
-		 * PrÃŒft allgemeine Fehler und gibt Sie im Backend aus 
+
+		/**
+		 * PrÃŒft allgemeine Fehler und gibt Sie im Backend aus
 		 */
 		public function checkGeneralBackendError()
 		{
-			
+
 			// Bei Ajaxanfragen etc. nix machen
 			if (isset($_REQUEST['noheader']) && $_REQUEST['noheader'] == '1') return;
-			
+
 			if (is_array($this->arLizenz) && isset($this->arLizenz['l']))
 			{
-				
+
 				// Hinweis auf nicht registrierte Domains
 				if ((!isset($_REQUEST['subaction']) || $_REQUEST['subaction'] != 'domains') && (isset($_REQUEST['do']) && $_REQUEST['do'] != 'register'))
 				{
-				
+
 					$arURLs = $this->get_option('wpsg_registredURLs');
-					
+
 					$url = preg_replace('/(.*)\/\//', '', $this->get_option('siteurl'));
-					
+
 					if (!in_array($url, (array)$arURLs))
 					{
-						
+
 						$this->addBackendMessage('nohspc_'.wpsg_translate(__('<b>wpShopGermany:</b> Bitte registrieren Sie diese Domain. Sie kÃ¶nnen dies ganz einfach im <a href="#1#">Lizenzmanager</a> durchfÃŒhren.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung'));
-						
-					}
-					
-				}
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			if (
 				$this->get_option("wpsg_version_installed", true) != false &&
-				$this->get_option("wpsg_version_installed", true) != WPSG_VERSION && 
-				$this->get_option('wpsg_message_db') != '1')				
-			{
-				
+				$this->get_option("wpsg_version_installed", true) != WPSG_VERSION &&
+				$this->get_option('wpsg_message_db') != '1')
+			{
+
 				$this->addBackendError('nohspc_'.wpsg_translate(
 					__('Ihre Datenbankversion ist nicht auf dem aktuellen Stand, aktualisieren Sie die Datenbank, indem Sie <a href="#1#">hier</a> klicken.<br />Klicken Sie <a href="#1#">hier</a>, um die Meldung auszublenden.', 'wpsg'),
@@ -3205,20 +3208,20 @@
 					WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&noheader=1&action=clearMessage&wpsg_message=wpsg_message_soaphint&wpsg_redirect='.rawurlencode($_SERVER['REQUEST_URI'])
 				));
-				
-			}
-			
+
+			}
+
 			if (!is_object($this->getDefaultCountry()))
 			{
-				
+
 				$this->addPersistentBackendError(wpsg_translate(
 					__('Es wurde kein Standardland definiert, der Shop kann so nicht korrekt betrieben werden. Bitte ÃŒberprÃŒfen Sie die <a href="#1#">LÃ€nderkonfiguration</a>.', 'wpsg'),
 					WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=laender'
 				), 'wpsg_message_nodefaultcountry');
-				
-			}
-			
+
+			}
+
 			if (!class_exists('SoapClient') && $this->get_option('wpsg_message_soaphint') != '1')
 			{
-				
+
 				$this->addPersistentBackendError(wpsg_translate(
 					__('Ihrem Server fehlt die PHP-Bibliothek fÃŒr die SOAP-UnterstÃŒtzung. Eine Registrierung Ihrer Domain ist somit nicht mÃ¶glich! <br />Weitere Informationen finden Sie in unseren <a target="_blank" href="http://wpshopgermany.maennchen1.de/faqs/wie-pruefe-ich-ob-soap-und-curl-auf-meinem-server-aktiviert-sind/">FAQ</a>. Klicken Sie <a href="#1#">hier</a>, um die Meldung auszublenden.', 'wpsg'),
@@ -3231,5 +3234,5 @@
 			if (@$_REQUEST['subaction'] != 'seiten' && ($this->get_option('wpsg_page_basket') === false || $this->get_option('wpsg_page_basket') <= 0 || !get_page($this->get_option('wpsg_page_basket'))))
 			{
-								
+
 				// Keine Warenkorbseite definiert
 				$this->addPersistentBackendError(
@@ -3240,18 +3243,18 @@
 					'wpsg_messsage_basketpage'
 				);
-				
-			}
-			
+
+			}
+
 			// Schreibrechte auf der Sprachdatei
 			if (file_exists(WPSG_PATH_TRANSLATION) && !is_writable(WPSG_PATH_TRANSLATION)) { $this->addBackendError('nohspc_'.__('<b>wpShopGermany:</b> Sprachdatei kann nicht geschrieben werden! PrÃŒfen Sie die Schreibrechte auf folgender Datei:<br /><b>'.WPSG_PATH_TRANSLATION.'</b>', 'wpsg')); }
-			
+
 			// Kundenmailanhang prÃŒfen
-			if (wpsg_isSizedString($this->get_option('wpsg_kundenmail_attachfile')) && !file_exists(wpsg_getUploadDir('wpsg_mailconf').$this->get_option('wpsg_kundenmail_attachfile'))) 
+			if (wpsg_isSizedString($this->get_option('wpsg_kundenmail_attachfile')) && !file_exists(wpsg_getUploadDir('wpsg_mailconf').$this->get_option('wpsg_kundenmail_attachfile')))
 				$this->addBackendError('nohspc_'.wpsg_translate(__('Es ist ein Anhang der Kundenmail definiert, die Datei wurde aber nicht gefunden. <a href="#1#">Zur E-Mail Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf'));
-			
+
 			// Alte UserViews checken
 			if (file_exists(WPSG_PATH_USERVIEW_OLD))
 			{
-				
+
 				$this->addPersistentBackendError(wpsg_translate(
 					__('Es existieren noch alte angepasste Templates unter #1#. Kopieren Sie diese bitte nach #2#. ZukÃŒnftig werden die Templateanpassungen nicht mehr im Pluginverzeichnis gesucht. Weitere Informationen erhalten Sie auch <a href="#3#">hier</a> oder auch in unserem kostenlosen <a href="#4#">Forum</a>.', 'wpsg'),
@@ -3261,10 +3264,10 @@
 					'http://forum.maennchen1.de'
            		), 'wpsg_message_olduserview');
-				
-			}
-			 
+
+			}
+
 			if (!$this->hasMod('wpsg_mod_ordercondition'))
 			{
-			
+
 				$this->addPersistentBackendError(wpsg_translate(
             		__('Ab der wpShopGermany Version 3.4 kann das kostenlose Modul "<a href="#1#">Bestellbedingungen</a>" verwendet werden. Sie kÃ¶nnen es <a href="#2#">hier</a> konfigurieren. ÃberprÃŒfen Sie auch die anderen Ãnderungen, die wir <a href="#3#">in unserem Artikel</a> nÃ€her erlÃ€utern.', 'wpsg'),
@@ -3273,20 +3276,20 @@
 					'http://wpshopgermany.maennchen1.de/?p=13952'
 				), 'wpsg_message_ordercondition_34');
-								
-			}
-			
+
+			}
+
 			$this->callMods('checkGeneralBackendError');
-			
+
 			/** Schreibrechte auf dem Pluginverzeichnis um Module zu installieren
-			  
-			if (!is_writable(WPSG_PATH) && $this->get_option('wpsg_message_pluginwrite') != '1') $this->addBackendError('nohspc_'.wpsg_translate(__('<b>wpShopGermany:</b> Das Pluginverzeichnis (#1#) ist nicht durch den Webserver beschreibbar. Die wpShopGermany Module lassen sich mÃ¶glicherweise nicht automatisch installieren. Klicken Sie <a href="#2#">hier</a>, um die Meldung auszublenden.', 'wpsg'), 
+
+			if (!is_writable(WPSG_PATH) && $this->get_option('wpsg_message_pluginwrite') != '1') $this->addBackendError('nohspc_'.wpsg_translate(__('<b>wpShopGermany:</b> Das Pluginverzeichnis (#1#) ist nicht durch den Webserver beschreibbar. Die wpShopGermany Module lassen sich mÃ¶glicherweise nicht automatisch installieren. Klicken Sie <a href="#2#">hier</a>, um die Meldung auszublenden.', 'wpsg'),
 				WPSG_PATH,
 				WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&noheader=1&action=clearMessage&wpsg_message=wpsg_message_pluginwrite&wpsg_redirect='.rawurlencode($_SERVER['REQUEST_URI'])
 			));
-			
+
 			*/
-			
+
 		} // public function checkGeneralBackendError()
-		
+
 		/**
 		 * Wird von Wordpress aufgerufen ÃŒber add_filter('wp_head ...
@@ -3294,9 +3297,9 @@
 		public function wp_head()
 		{
-			
+
 			echo '<!-- wpShopGermany Version '.WPSG_VERSION.' -->';
-						
+
 			$this->callMods('wp_head');
-			
+
 		} // public function wp_head()
 
@@ -3306,45 +3309,45 @@
 		public function wp_foot()
 		{
-			
+
 			// Variable wird mein anzeigen eines Warenkorbes oder beim Anzeigen eines Produktes aufgerufen
 			// Widget kann dies auch auslÃ¶sen
 			if ($this->get_option('wpsg_geo_determination') !== '4')
 			{
-			
+
 				$default_country = $this->getDefaultCountry();
-			
+
 				if ($this->showEULayer && wpsg_geo_code() != strtolower($default_country->kuerzel))
 				{
-				
+
 					// Wurde der Dialog schon beantwortet?
 					if (!isset($_SESSION['wpsg']['priceDialog']) || $_SESSION['wpsg']['priceDialog'] !== true)
 					{
-					
+
 						echo '<script type="text/javascript">/* <![CDATA[ */';
-											
+
 						//echo 'jQuery(document).ready(function() { wpsg_customerquestion("'.$this->getCurrentURL().'"); } );';
-						
+
 						//Lieber die REQUEST_URI, damit alle _GET Variablen erhalten bleiben
 						echo 'jQuery(document).ready(function() { wpsg_customerquestion("'.$_SERVER['REQUEST_URI'].'"); } );';
-						
-						echo '/* ]]> */</script>'; 
-						
-					}
-					 
-				}
-				
-			}
-			
+
+						echo '/* ]]> */</script>';
+
+					}
+
+				}
+
+			}
+
 			if (($this->hasFrontendError() || $this->hasFrontendMessage()) && $this->bMessageOut === false)
 			{
-								
+
 				echo $this->render(WPSG_PATH_VIEW.'warenkorb/messageDialog.phtml');
-												
-			}
-			
+
+			}
+
 			$this->callMods('wp_foot');
-			
+
 		} // public function wp_foot()
-		 		
+
 		/**
 		 * Verteilt den Wert $value auf die MwSt SÃ€tze in $arBasket
@@ -3353,15 +3356,15 @@
 		public function subMwSt(&$arBasket, $value)
 		{
-			
+
 			if (wpsg_tf($value) <= 0) return 0;
-					
+
 			$price_option = WPSG_BRUTTO; //$this->get_option('wpsg_preisangaben');
 			//if (isset($arBasket['price_frontend']))
 			//	$price_option = $arBasket['price_frontend'];
-			
+
 			// Anteilig auf die SÃ€tze verteilen
 			foreach ((array)$arBasket['mwst'] as $mw_id => $mw)
 			{
-				 
+
 				if ($mw['base_value'] > 0)
 				{
@@ -3369,39 +3372,39 @@
 					{
 						$proz = $mw['base_value'] / $arBasket['sum']['preis_brutto'];
-						
+
 						$arBasket['mwst'][$mw_id]['base_value'] -= $proz * $value;
 						$arBasket['mwst'][$mw_id]['sum'] = wpsg_calculateSteuer($arBasket['mwst'][$mw_id]['base_value'], WPSG_BRUTTO, $mw['value']);
-						
+
 					}
 					else
 					{
 						$proz = $mw['base_value'] / $arBasket['sum']['preis_netto'];
-						
+
 						$arBasket['mwst'][$mw_id]['base_value'] -= $proz * $value;
 						$arBasket['mwst'][$mw_id]['sum'] = wpsg_calculateSteuer($arBasket['mwst'][$mw_id]['base_value'], WPSG_NETTO, $mw['value']);
-						
-					}
-					 
-				}
-				
-			} 
-			
+
+					}
+
+				}
+
+			}
+
 			// Mehrwertsteuer Summe korrigieren
 			$sum_mwst = 0;
 			foreach ($arBasket['mwst'] as $mw_id => $mw)
 			{
-				
+
 				$sum_mwst += $arBasket['mwst'][$mw_id]['sum'];
-				
-			}
-			
+
+			}
+
 			$sub = $arBasket['sum']['mwst'];
-			
+
 			$arBasket['sum']['mwst'] = abs($sum_mwst);
-						
-			return $sub - $arBasket['sum']['mwst']; 
-			
+
+			return $sub - $arBasket['sum']['mwst'];
+
 		} // public function subMwSt(&$arBasket, $value)
-		
+
 		/**
 		 * Ermittelt den zu besteuernden Teil eines Nettowertes und verteilt ihn auf die MwSt. SÃ€tze in $arBasket
@@ -3410,15 +3413,15 @@
 		public function addMwSt(&$arBasket, $value)
 		{
-			
+
 			if (wpsg_tf($value) <= 0) return 0;
-			
+
 			$price_option = WPSG_BRUTTO; //$this->get_option('wpsg_preisangaben');
 			//if (isset($arBasket['price_frontend']))
 			//	$price_option = $arBasket['price_frontend'];
-			
+
 			// Anteilig auf die SÃ€tze verteilen
 			foreach ((array)$arBasket['mwst'] as $mw_id => $mw)
 			{
-				
+
 				if ($mw['base_value'] > 0)
 				{
@@ -3426,40 +3429,40 @@
 					{
 						$proz = $mw['base_value'] / $arBasket['sum']['preis_brutto'];
-						
+
 						$arBasket['mwst'][$mw_id]['base_value'] -= wpsg_calculatePreis($proz * $value, WPSG_BRUTTO, $mw['value']);
 						$arBasket['mwst'][$mw_id]['sum'] = wpsg_calculateSteuer($arBasket['mwst'][$mw_id]['base_value'], WPSG_BRUTTO, $mw['value']);
-						
+
 					}
 					else
 					{
 						$proz = $mw['base_value'] / $arBasket['sum']['preis_netto'];
-						
+
 						//$arBasket['mwst'][$mw_id]['base_value'] -= wpsg_calculatePreis($proz * $value, WPSG_NETTO, $mw['value']);
 						$arBasket['mwst'][$mw_id]['base_value'] -= $proz * $value;
 						$arBasket['mwst'][$mw_id]['sum'] = wpsg_calculateSteuer($arBasket['mwst'][$mw_id]['base_value'], WPSG_NETTO, $mw['value']);
-						
-					}
-					  
-				}
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			// Mehrwertsteuer Summe korrigieren
 			$sum_mwst = 0.0;
 			foreach ($arBasket['mwst'] as $mw_id => $mw)
 			{
-				
+
 				$sum_mwst += $arBasket['mwst'][$mw_id]['sum'];
-				
-			}
-			
+
+			}
+
 			$sub = $arBasket['sum']['mwst'];
-			
+
 			$arBasket['sum']['mwst'] = abs($sum_mwst);
-			
-			return $sub - $arBasket['sum']['mwst']; 
-			
+
+			return $sub - $arBasket['sum']['mwst'];
+
 		} // public function addMwSt(&$arBasket, $value)
-		
+
 		/**
 		 * Gibt den Wert einer benutzerdefinierten Kundenvariable zurÃŒck wenn die Bestellung noch nicht in der Datenbank ist
@@ -3467,15 +3470,15 @@
 		public function getCustomerFieldFromSession($field_id)
 		{
-			
+
 			if (!isset($_SESSION['wpsg']['checkout']['custom'][$field_id])) return;
-			
+
 			$pflicht = $this->loadPflichtFeldDaten();
-			
+
 			if (!is_array($pflicht) || !isset($pflicht['custom'][$field_id])) return;
-			
+
 			return $_SESSION['wpsg']['checkout']['custom'][$field_id];
-			
+
 		} // public function getCustomerFieldFromSession($field_id)
-		
+
 		/**
 		 * Gibt den Wert einer benutzerdefinierten Kundenvariable zurÃŒck wenn die Bestellung schon in der Datenbank ist
@@ -3483,43 +3486,43 @@
 		public function getCustomFieldFromDB($customer_id, $field_id)
 		{
-			
+
 			$kunde_data = $this->cache->loadKunden($customer_id);
 			$kunde_data['custom'] = @unserialize($kunde_data['custom']);
 
 			if (!is_array($kunde_data)) return;
-			
+
 			if (!isset($kunde_data['custom'][$field_id])) return;
-			
+
 			$pflicht = $this->loadPflichtFeldDaten();
-			
+
 			if (!is_array($pflicht) || !isset($pflicht['custom'][$field_id])) return;
-			
+
 			return $kunde_data['custom'][$field_id];
-			
+
 		} // public function getCustomFieldFromDB($customer_id, $field_id)
-		
+
 		/**
 		 * Setzt eine Zahlung fÃŒr eine Bestellung
-		 * 
+		 *
 		 * Gibt true zurÃŒck wenn die Bestellung komplett beglichen werden kann
-		 * 
+		 *
 		 */
 		public function setPayMent($order_id, $pay_amount)
 		{
-			
+
 			$order_data = $this->cache->loadOrder($order_id);
-			
+
 			if (round(doubleval($order_data['price_gesamt']), 2) == round(doubleval($pay_amount), 2))
 			{
-				
+
 				// Alles grÃŒn, Zahlung stimmt mit Bestellwert ÃŒberein
 				return true;
-				
+
 			}
 			else
 			{
-				
+
 				$logTitle = wpsg_translate(__('Versuchte Zahlung ÃŒber #1#.', 'wpsg'), wpsg_ff($pay_amount, $this->get_option('wpsg_currency')));
-				
+
 				// Hier mal was ins Log schreiben
 				$this->db->ImportQuery(WPSG_TBL_OL, array(
@@ -3529,11 +3532,11 @@
 					"mailtext" => wpsg_q(print_r($_REQUEST, 1)."\r\n".print_r($_SERVER, 1))
 				));
-				
-			}
-			
+
+			}
+
 			return false;
-			
+
 		} // public function setPayMent($order_id, $pay_amount)
-		
+
 		/**
 		 * LÃ€dt die Daten fÃŒr die Pflichtfelder und beachtet die Ãbersetzungen
@@ -3541,27 +3544,27 @@
 		public function loadPflichtFeldDaten()
 		{
-			
+
 			$arPflicht = $this->get_option('wpsg_admin_pflicht');
-			
+
 			// Mann|Frau usw. ÃŒbersetzen
-			$arPflicht['anrede_auswahl'] = __($arPflicht['anrede_auswahl'], 'wpsg'); 
+			$arPflicht['anrede_auswahl'] = __($arPflicht['anrede_auswahl'], 'wpsg');
 
 			if (wpsg_isSizedArray($arPflicht['custom']))
 			{
-			
+
 				foreach ($arPflicht['custom'] as $k => $v)
 				{
-					
+
 					$arPflicht['custom'][$k]['name'] = __($arPflicht['custom'][$k]['name'], 'wpsg');
 					$arPflicht['custom'][$k]['auswahl'] = __($arPflicht['custom'][$k]['auswahl'], 'wpsg');
-					
-				}
-			
-			}
-			
+
+				}
+
+			}
+
 			return $arPflicht;
-			
+
 		} // public function loadPflichtFeldDaten()
-		
+
 		/**
 		 * Baut die Bestellnummer
@@ -3569,15 +3572,15 @@
 		public function buildONR($o_id, $k_id, $knr)
 		{
-			
+
 			$onr_modul = "";
 			if ($this->callMods('buildONR', array(&$k_id, &$o_id, &$onr_modul)) === false)
 			{
-			
+
 				return $onr_modul;
-			
-			}
-			
+
+			}
+
 			$onr = $this->get_option('wpsg_order_start');
-				
+
 			if (trim($this->get_option('wpsg_format_onr')) == '')
 			{
@@ -3588,5 +3591,5 @@
 				$format = $this->get_option('wpsg_format_onr');
 			}
-				
+
 			$arReplace = array(
 					'/%Y%/' => date('Y'),
@@ -3603,15 +3606,15 @@
 					'/%kunde_knr%/' => $knr
 			);
-				
+
 			$strReturn = preg_replace(array_keys($arReplace), array_values($arReplace), $format);
 			$strReturn = $this->replaceUniversalPlatzhalter($strReturn, $o_id, $k_id);
-				
+
 			// Bestellnummer ZÃ€hler hochzÃ€hlen
 			$this->update_option('wpsg_order_start', intval($this->get_option('wpsg_order_start')) + 1);
-			
+
 			return $strReturn;
-				
+
 		} // private function buildONR($o_id, $k_id)
-		
+
 		/**
 		 * Erstellt die Kundennummer (Wird vom Basket bei Bestellung und vom Kundenmodul bei Registrierung genutzt)
@@ -3619,15 +3622,15 @@
 		public function buildKNR($k_id)
 		{
-			
+
 			$knr_modul = "";
 			if ($this->callMods('buildKNR', array(&$k_id, &$knr_modul)) === false)
 			{
-				 
+
 				return $knr_modul;
-				
-			} 
-			
+
+			}
+
 			$knr = $this->get_option('wpsg_customer_start');
-			
+
 			if (trim($this->get_option('wpsg_format_knr')) == '')
 			{
@@ -3638,5 +3641,5 @@
 				$format = $this->get_option('wpsg_format_knr');
 			}
-			
+
 			$arReplace = array(
 				'/%Y%/' => date('Y'),
@@ -3652,15 +3655,15 @@
 				'/%id%/' => $k_id
 			);
-			
+
 			$strReturn = preg_replace(array_keys($arReplace), array_values($arReplace), $format);
 			$strReturn = $this->replaceUniversalPlatzhalter($strReturn, false, $k_id);
-			
+
 			// Kundennummer ZÃ€hler hochzÃ€hlen
 			$this->update_option('wpsg_customer_start', intval($this->get_option('wpsg_customer_start')) + 1);
-			
+
 			return $strReturn;
-			
+
 		} // private function buildKNR($k_id)
-		 
+
 		/**
 		 * Hilfsfunktion um die Versandarten zusammenzufÃŒgen und Kombinationen zu bilden
@@ -3669,5 +3672,5 @@
 		public function mergeShipping($arShipping1, $arShipping2)
 		{
-					
+
 			/*
 			wpsg_debug("merge");
@@ -3675,138 +3678,138 @@
 			wpsg_debug($arShipping2);
 			*/
-						
+
 			$arReturn = array();
-			 
+
 			$arIntersect = array_intersect($arShipping1, $arShipping2);
-									
+
 			if (wpsg_isSizedArray($arIntersect) && (sizeof($arIntersect) > 1 || !array_search('130', $arIntersect)))
 			//if (wpsg_isSizedArray($arIntersect))
 			{
-				
+
 				$arReturn = $arIntersect;
-				
+
 			}
 			else
 			{
-			
+
 				// Jedes mit jedem prÃŒfen
 				foreach ($arShipping1 as $shipping1)
 				{
-					
+
 					foreach ($arShipping2 as $shipping2)
 					{
-						
+
 						if (is_array($shipping1))
 						{
-	 
+
 							if (!in_array($shipping2, $shipping1))
 							{
-													
+
 								$s_merge = $shipping1;
 								$s_merge[] = $shipping2;
-							
+
 								// Ob die Kombination im RÃŒckgabe Array schon gefunden wurde
 								$bFoundKombination = false;
-								 
+
 								foreach ($arReturn as $r)
 								{
-									
+
 									if (!wpsg_isSizedArray(array_diff($r, $s_merge)))
 									{
-										
+
 										$bFoundKombination = true; break;
-										
+
 									}
-									
+
 								}
-								
+
 								if (!$bFoundKombination)
 								{
-									 
+
 									$arReturn[] = $s_merge;
-									
+
 								}
-								
+
 							}
 							else
 							{
-								
+
 								$bDrin = false;
-								
+
 								foreach ($arReturn as $r)
 								{
-									
+
 									if (is_array($r) && !wpsg_isSizedArray(array_diff($r, $shipping1))) $bDrin = true;
-									
+
 								}
-								
+
 								if (!$bDrin) $arReturn[] = $shipping1;
-								
+
 							}
-							
+
 						}
 						else
 						{
-						
+
 							// Ob die Kombination im RÃŒckgabe Array schon gefunden wurde
 							$bFoundKombination = false;
-							
+
 							foreach ($arReturn as $r)
 							{
-								
+
 								if (in_array($shipping1, $r) && in_array($shipping2, $r))
 								{
-									
+
 									$bFoundKombination = true; break;
-																	
+
 								}
-								
+
 							}
-							
-							if (!$bFoundKombination) 
+
+							if (!$bFoundKombination)
 							{
-								
+
 								$arReturn[] = array($shipping1, $shipping2);
-								
+
 							}
-							
+
 						}
-						
-					}
-					
-				}
-				
-			}
-			 
+
+					}
+
+				}
+
+			}
+
 			return $arReturn;
-			
+
 		} // private function mergeShipping($arShipping1, $arShipping2)
-		
+
 		/**
 		 * Gibt den Namen der Versandart zurÃŒck
-		 * Ist notwendig geworden, da die Versandarten zusammengefÃŒgt wurden. 
-		 * In $this->arShipping sind schon die zusammengefÃŒgten Pakete drin 
+		 * Ist notwendig geworden, da die Versandarten zusammengefÃŒgt wurden.
+		 * In $this->arShipping sind schon die zusammengefÃŒgten Pakete drin
 		 */
 		public function getShippingName($shipping_key)
 		{
-			
-			if (array_key_exists($shipping_key, $this->arShipping)) 
-			{ 
-				
-				return __($this->arShipping[$shipping_key]['name'], 'wpsg'); 
-			
-			} 
+
+			if (array_key_exists($shipping_key, $this->arShipping))
+			{
+
+				return __($this->arShipping[$shipping_key]['name'], 'wpsg');
+
+			}
 			else
 			{
-				
+
 				return wpsg_translate(__('Deaktivierte Versandart (#1#)', 'wpsg'), $shipping_key);
-				
-			}
-			
-		} // public function getShippingName($shipping_key)		
-		
+
+			}
+
+		} // public function getShippingName($shipping_key)
+
 		/**
 		 * Gibt den Produktnamen als HTML zurÃŒck
-		 * - Wenn Detailname, dann der Detailname 
+		 * - Wenn Detailname, dann der Detailname
 		 * - Box^4 wird in Box<span class="wpsg_upper">4</div>
 		 * @param bool $detailname Wenn auf true, dann wird der Detailname verwendet wenn vorhanden
@@ -3815,11 +3818,11 @@
 		public function getProductName($product_id, $detailname = false)
 		{
-			
+
 			$oProduct = wpsg_product::getInstance($product_id);
-			
-			return $oProduct->getProductName($detailname); 
-			
+
+			return $oProduct->getProductName($detailname);
+
 		} // public function getProductName($product_id)
-		
+
 		/**
 		 * ÃberprÃŒft die vorhandenen Versandarten und entfernt Versandarten die im Warenkorb nicht erlaubt sind
@@ -3827,26 +3830,26 @@
 		public function checkShippingAvailable()
 		{
-			
+
 			$arShippingNew = array();
-			
+
 			// 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();
-			
+
 			if (wpsg_isSizedArray($this->view['basket']['produkte']) && !$this->bShippingMerged)
 			{
-				
-				$arSystemShippingAllowed = array_keys($this->arShipping);				
+
+				$arSystemShippingAllowed = array_keys($this->arShipping);
 				$arProductShippingAllowd = $arSystemShippingAllowed;
-				
+
 				$bDontMerge130 = wpsg_isSizedInt($this->get_option('wpsg_mod_willcollect_dontMerge'));
 				$bMerge130 = false;
 				$bMoreThen130Allowed = true;
-				
+
 				// Schauen welche Versandarten ÃŒbrig bleiben
 				foreach ($this->view['basket']['produkte'] as $basket_product)
 				{
-					
+
 					$oProduct = $this->cache->loadProductObject($this->getProduktID($basket_product['id']));
-					
+
 					if ($oProduct->hasLimitedShipping())
 					{
@@ -3854,28 +3857,28 @@
 						$arSingleProductShippingAllowed = array_intersect($arSystemShippingAllowed, $oProduct->getAllowedShipping());
 						$arProductShippingAllowd = array_intersect($arProductShippingAllowd, $arSingleProductShippingAllowed);
-									
+
 						if (sizeof($arSingleProductShippingAllowed) === 1 && in_array('130', $arSingleProductShippingAllowed)) $bMoreThen130Allowed = false;
 						else $bMoreThen130Allowed = $bMoreThen130Allowed && true;
-																		
+
 					}
 					else $bMoreThen130Allowed = true;
-					
-				}
-				 
+
+				}
+
 				if ($bMoreThen130Allowed === true && (!wpsg_isSizedArray($arProductShippingAllowd) || (sizeof($arProductShippingAllowd) == 1 && in_array('130', $arProductShippingAllowd))))
 				{
-					
+
 					// Es ist keine Versandart ÃŒbrig geblieben oder nur Selbstabholung
 					// SofortÃŒberweisung soll zusÃ€tzlich drin bleiben die anderen aber kombiniert werden
 					// SofortÃŒberweisung rausnehmen
 					$arSystemShippingAllowedMerged = $arSystemShippingAllowed;
-					 
+
 					if (in_array('130', $arSystemShippingAllowed) && $bDontMerge130) unset($arSystemShippingAllowedMerged[array_search('130', $arSystemShippingAllowedMerged)]);
-					
+
 					foreach ($this->view['basket']['produkte'] as $basket_product)
 					{
-						
+
 						$oProduct = $this->cache->loadProductObject($this->getProduktID($basket_product['id']));
-						
+
 						if ($oProduct->hasLimitedShipping())
 						{
@@ -3885,57 +3888,57 @@
 							if (in_array('130', $arSingleProductShippingAllowed) && $bDontMerge130)
 							{
-								
+
 								unset($arSingleProductShippingAllowed[array_search('130', $arSingleProductShippingAllowed)]);
 								if (wpsg_isSizedArray($arSingleProductShippingAllowed) > 0) $arSystemShippingAllowedMerged = $this->mergeShipping($arSystemShippingAllowedMerged, $arSingleProductShippingAllowed);
 								else
 								{
-									
+
 									//$arSystemShippingAllowedMerged = array();
 									$bMerge130 = true;
-									
+
 								}
-								 
+
 							}
 							else
 							{
-								
+
 								$arSystemShippingAllowedMerged = $this->mergeShipping($arSystemShippingAllowedMerged, $arSingleProductShippingAllowed);
-								
+
 							}
-								
+
 						}
-						
-					}
-					 
-				}
-				else 
-				{
-					
+
+					}
+
+				}
+				else
+				{
+
 					$arSystemShippingAllowedMerged = $arProductShippingAllowd;
-					
-				}
-				
-				// Selbstabholung wieder mit rein				
+
+				}
+
+				// Selbstabholung wieder mit rein
 				if ($bDontMerge130 && in_array('130', $arProductShippingAllowd) && !in_array('130', $arSystemShippingAllowedMerged)) $arSystemShippingAllowedMerged[] = '130';
-			
+
 				if ($bMerge130 && wpsg_isSizedArray($arSystemShippingAllowedMerged[0]) > 0 && !in_array('130', $arSystemShippingAllowedMerged))
 				{
-					
+
 					$arSystemShippingAllowedMerged[0][] = '130';
-					
-				}
-			
-				//$arSystemShippingAllowedMerged = wpsg_trim($arSystemShippingAllowedMerged);			
-			
+
+				}
+
+				//$arSystemShippingAllowedMerged = wpsg_trim($arSystemShippingAllowedMerged);
+
 				foreach ($arSystemShippingAllowedMerged as $shipping)
 				{
-				
+
 					if (is_array($shipping))
 					{
-							
+
 						asort($shipping, SORT_STRING);
-							
+
 						$subKey = implode('-', $shipping);
-				
+
 						$arShippingNew[$subKey] = array(
 							'id' => $subKey,
@@ -3943,42 +3946,42 @@
 							'price' => 0
 						);
-							
+
 						foreach ($shipping as $subShipping)
 						{
-				
+
 							$sub = $this->arShipping[$subShipping];
-				
+
 							$arShippingNew[$subKey]['name'] = implode(' + ', wpsg_trim(array_merge(array($sub['name']), (array)explode(',', $arShippingNew[$subKey]['name']))));
 							$arShippingNew[$subKey]['hint'] = implode('<br /><br />', wpsg_trim(array_merge(array($sub['hint']), (array)explode(',', $arShippingNew[$subKey]['hint']))));
-				
+
 							if (isset($arShippingNew[$subKey]['price'])) $arShippingNew[$subKey]['price'] = $arShippingNew[$subKey]['price'] + $sub['price'];
 							else if (isset($sub['price'])) $arShippingNew[$subKey]['price'] = $sub['price'];
-				
+
 							$arShippingNew[$subKey]['sub'][$subShipping] = $sub;
-				
+
 						}
-							
+
 					}
 					else
 					{
-							
+
 						$arShippingNew[$shipping] = $this->arShipping[$shipping];
-							
-					}
-				
-				}
-
-				$this->arShipping = $arShippingNew;				
+
+					}
+
+				}
+
+				$this->arShipping = $arShippingNew;
 				$this->bShippingMerged = true;
-				
-			}
-			
+
+			}
+
 			// UnschÃ¶ne Warnungen verhindern, sollte hier der Array null sein
 			if (!wpsg_isSizedArray($this->arShipping)) $this->arShipping = array();
 
 			$this->callMods('checkShippingAvailable', array(&$this->arShipping, &$this->view['basket']));
-			
+
 		} // public function checkShippingAvailable()
-		
+
 		/**
 		 * ÃberprÃŒft die vorhandenen Zahlungsarten und entfernt Zahlungsarten die im Warenkorb nicht elaubt sind
@@ -3992,37 +3995,37 @@
 				foreach ($this->view['basket']['produkte'] as $basket_product)
 				{
-					
+
 					$oProduct = $this->cache->loadProductObject($this->getProduktID($basket_product['id']));
-					 
+
 					if ($oProduct->hasLimitedPayment())
 					{
-						
+
 						$arPaymentAllowed = $oProduct->getAllowedPayment();
-						
+
 						foreach ($this->arPayment as $payment_key => $payment)
 						{
-						 
+
 							if (!in_array($payment['id'], $arPaymentAllowed))
 							{
-								 
+
 								unset($this->arPayment[$payment_key]);
-								
+
 							}
-							
+
 						}
-						
-					}
-					
-				}
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			// UnschÃ¶ne Warnungen verhindern, sollte hier der Array null sein
 			if (!wpsg_isSizedArray($this->arPayment)) $this->arPayment = array();
-			
+
 			$this->callMods('checkPaymentAvailable', array(&$this->arPayment, &$this->view['basket']));
-			
+
 		} // public function checkPaymentAvailable()
-		
+
 		/**
 		* Gibt den Namen der Zahlungsart zurÃŒck (Eingebaut fÃŒr CrefoPay)
@@ -4032,15 +4035,15 @@
 		* @param Integer $order_id BestellID
 		*/
-		public function getPaymentName($payment_type, $order_id) 
-		{
- 
-			$payment_name = $this->arPayment[$payment_type]['name']; 
-			
+		public function getPaymentName($payment_type, $order_id)
+		{
+
+			$payment_name = $this->arPayment[$payment_type]['name'];
+
 			$this->callMods('getPaymentName', array($payment_type, $order_id, &$payment_name));
-			
+
 			return $payment_name;
-			
-		} // public function getPaymentName($payment_type, $order_id) 
-		
+
+		} // public function getPaymentName($payment_type, $order_id)
+
 		/**
 		 * Ermittelt ob im Backend Netto oder Brutto Preise angezeigt und definiert werden sollen
@@ -4048,9 +4051,9 @@
 		public function getBackendTaxview()
 		{
-			
+
 			return $this->get_option('wpsg_preisangaben');
-			
+
 		} // public function getBackendTaxview()
-		
+
 		/**
 		 * Ermittelt ob im Frontend Netto oder Brutto Preise angezeigt werden sollen
@@ -4058,44 +4061,44 @@
 		public function getFrontendTaxview()
 		{
-			
+
 			// Kleinunternehmer sehen immer im Frontend NETTO ab 17.02.2016 egal was bei Frontend/Brutto eingestellt ist
 			if ($this->get_option('wpsg_kleinunternehmer') == '1') return WPSG_NETTO;
-			
+
 			if (isset($_SESSION['wpsg']['customertype']) && $_SESSION['wpsg']['customertype'] == 0)
 			{
-				
+
 				// Hier hat der Kunde die Auswahl "Firmenkunde" getroffen --> Netto anzeigen
 				return WPSG_NETTO;
-				
-			}
-			
+
+			}
+
 			$nFrontendTaxview = $this->get_option('wpsg_preisangaben_frontend');
-			
+
 			if ($this->hasMod('wpsg_mod_kundenverwaltung'))
 			{
-				
+
 				$customer_group_id = $this->callMod('wpsg_mod_kundenverwaltung', 'getCustomerGroup');
-				
+
 				if (wpsg_isSizedInt($customer_group_id))
 				{
-					
+
 					$oCustomerGroup = $this->callMod('wpsg_mod_kundenverwaltung', 'getCustomerGroupObject', array($customer_group_id));
-					
+
 					if ($oCustomerGroup->calculation >= 0)
 					{
-						
+
 						$nFrontendTaxview = $oCustomerGroup->calculation;
-						
-					}
-					
-				}
-				
-			}
-				
+
+					}
+
+				}
+
+			}
+
 			return $nFrontendTaxview;
-			
+
 		} // public function getFrontendTaxview()
-			
+
 	} // class ShopController extends SystemController
-	
+
 ?>
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 6337)
+++ /model/wpsg_product.class.php	(revision 6338)
@@ -15,5 +15,5 @@
 
 		public $product_key = "";
-		
+
 		/**
 		 * LÃ€dt die Daten des Produkts
@@ -23,10 +23,10 @@
 
 			parent::load($product_id);
-							
+
 			$this->data = $this->db->fetchRow("SELECT P.* FROM `".WPSG_TBL_PRODUCTS."` AS P WHERE P.`id` = '".wpsg_q($product_id)."' ");
 
 			if ($this->shop->isOtherLang())
 			{
-			
+
 				$trans_produkt = $this->db->fetchRow("
 					SELECT
@@ -38,47 +38,47 @@
 						P.`lang_parent` = '".wpsg_q($product_id)."'
 				");
-			
+
 				if ($trans_produkt['id'] > 0)
 				{
-						
+
 					$this->data['name'] = $trans_produkt['name'];
 					$this->data['beschreibung'] = $trans_produkt['beschreibung'];
 					$this->data['detailname'] = $trans_produkt['detailname'];
-						
+
 				}
-				
-			}
-			 
+
+			}
+
 			$this->loadedData = $this->shop->loadProduktArray($product_id);
-			
+
 			if ($this->data['id'] != $product_id) throw new \wpsg\Exception(wpsg_translate(__('Gesuchte ID:#1# Gefundene ID:#2#', 'wpsg'), $product_id, $this->data['id']));
 
 			return true;
-				
+
 		} // public function load($product_id)
-		
+
 		public function appendData($arData)
 		{
-			
+
 			$this->loadedData = $arData;
-			
+
 		} // public function appendData($arData)
-		
+
 		public function delete()
 		{
-						 
+
 			$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, array(
 				'deleted' => '1'
 			), "`id` = '".wpsg_q($this->id)."'");
-				
+
 			$this->shop->callMods('produkt_del', array($this->id));
-				
+
 			// Ãbersetzung lÃ¶schen
 			$this->db->UpdateQuerY(WPSG_TBL_PRODUCTS, array(
 				'deleted' => '1'
 			), "`lang_parent` = '".wpsg_q($this->id)."'");
-						
+
 		} // public function delete()
-		
+
 		/**
 		 * Setzt den Produkt Key
@@ -86,9 +86,9 @@
 		public function setProductKey($product_key)
 		{
-			
+
 			$this->product_key = $product_key;
-			
+
 		} // public function setProductKey($product_key)
-		
+
 		/**
 		 * Setzt einen Wert in der META Tabelle
@@ -96,18 +96,18 @@
 		public function setMeta($meta_key, $meta_value)
 		{
-				
+
 			$nExistsID = $this->db->fetchOne("SELECT M.`id` FROM `".WPSG_TBL_META."` AS M WHERE M.`meta_table` = 'WPSG_TBL_PRODUCTS' AND M.`meta_key` = '".wpsg_q($meta_key)."' AND `target_id` = '".wpsg_q($this->id)."' ");
-				
+
 			if (wpsg_isSizedInt($nExistsID))
 			{
-		
+
 				$this->db->UpdateQuery(WPSG_TBL_META, array(
 					'meta_value' => wpsg_q($meta_value)
 				), " `id` = '".wpsg_q($nExistsID)."' ");
-		
+
 			}
 			else
 			{
-		
+
 				$this->db->ImportQuery(WPSG_TBL_META, array(
 					'target_id' => wpsg_q($this->id),
@@ -116,9 +116,9 @@
 					'meta_value' => wpsg_q($meta_value)
 				));
-		
-			}
-				
+
+			}
+
 		} // public function setMeta($meta_key, $meta_value)
-		
+
 		/**
 		 * Gibt einen META Value zurÃŒck
@@ -126,9 +126,9 @@
 		public function getMeta($meta_key)
 		{
-				
+
 			$meta_value = $this->db->fetchOne("SELECT M.`meta_value` FROM `".WPSG_TBL_META."` AS M WHERE M.`meta_table` = 'WPSG_TBL_PRODUCTS' AND M.`meta_key` = '".wpsg_q($meta_key)."' AND `target_id` = '".wpsg_q($this->id)."' ");
-				
+
 			return $meta_value;
-				
+
 		} // public function getMeta($meta_key)
 
@@ -170,26 +170,26 @@
 			if (wpsg_isSizedString($strDetailname) && $detailname === true)
 			{
-				
+
 				$strName = $strDetailname;
-				
+
 			}
 			else
 			{
-			
+
 				$strName = $this->name;
-				
-			}
-			
+
+			}
+
 			if (strpos($strName, '^') !== false)
 			{
 
 				$strName = preg_replace('/\^/', '<span class="wpsg_upper">', $strName).'</span>';
-				
-			}
-			
+
+			}
+
 			return $strName;
-			
+
 		} // public function getProductName()
-		
+
 		/**
 		 * Gibt die ProduktURL zurÃŒck
@@ -198,50 +198,50 @@
 		public function getProductURL()
 		{
-			
+
 			$url = false;
-			
+
 			$this->shop->callMods('getProduktlink', array($this->id, &$url));
-			
+
 			if ($url === false)
 			{
-				
+
 				$partikel = $this->partikel;
-			
+
 				if (wpsg_isSizedInt($partikel))
 				{
-					
+
 					return get_permalink($this->partikel);
-					
+
 				}
 				else
 				{
-						
+
 					$basket_url = $this->shop->getURL(wpsg_ShopController::URL_BASKET);
-						
+
 					if (strpos($basket_url, "?") > 0)
 					{
-						
+
 						$basket_url .= "&wpsg_action=showProdukt&produkt_id=".$this->id;
-						
+
 					}
 					else
 					{
-						
+
 						$basket_url .= "?wpsg_action=showProdukt&produkt_id=".$this->id;
-						
+
 					}
-											
+
 					return $basket_url;
-						
+
 				}
-			
+
 			}
 			else
 			{
-			
+
 				return $url;
-			
-			}
-			
+
+			}
+
 		} // public function getProductURL()
 
@@ -252,8 +252,8 @@
 
 		} // public function getDefaultTaxValue()
- 
+
 		/**
 		 * Bestimmt ob das Produkt z.B. in den ProduktÃŒbersichten angezeigt werden kann
-		 * 
+		 *
 		 * @param String $product_key Der ProduktKey
 		 * @return bool true wenn das Produkt sichtbar ist
@@ -261,17 +261,17 @@
 		public function canDisplay($product_key = false)
 		{
-			
+
 			if ($product_key === false) $product_key = $this->id;
-					
+
 			// Module Checken
 			$bOK = $this->shop->callMods('canDisplay', array($product_key));
-			
+
 			return $bOK;
-			
+
 		} // public function canDisplay($product_key = false)
 
 		/**
 		 * Bestimmt ob der Preis des Produktes angezeigt werden darf
-		 * 
+		 *
 		 * @param String $product_key Der ProduktKey
 		 * @param bool $product_key true wenn der Preis angezeigt werden darf
@@ -279,51 +279,51 @@
 		public function canDisplayPrice($product_key = false)
 		{
-			
+
 			if ($product_key === false) $product_key = $this->id;
-			
+
 			// War mal im Produkt, muss aber auch ohne Produktbezug funktionieren z.B. fÃŒr den Preisfilter
-			// Im ShopController wird die Preisanzeige fÃŒr angemeldete Nutzer geprÃŒft			
+			// Im ShopController wird die Preisanzeige fÃŒr angemeldete Nutzer geprÃŒft
 			return $GLOBALS['wpsg_sc']->canDisplayPrice();
-						
+
 		} // public function canDisplayPrice($product_key = false)
-		
-		/**
-		 * Gibt true zurÃŒck, wenn das Produkt gekauft werden kann, false wenn nicht 
+
+		/**
+		 * Gibt true zurÃŒck, wenn das Produkt gekauft werden kann, false wenn nicht
 		 * Bestimmt ob der Button im Warenkorb angezeigt wird
 		 */
 		public function canOrder($product_key = false)
 		{
-				
+
 			if ($product_key === false) $product_key = $this->id;
-			 
+
 			// Anfrageprodukt?
 			if ($this->shop->hasMod('wpsg_mod_request'))
 			{
-							
+
 				$wpsg_mod_request_set = $this->getMeta('wpsg_mod_request_set');
-			
+
 				if (!(!is_numeric($wpsg_mod_request_set) || in_array($wpsg_mod_request_set, array(wpsg_mod_request::TYP_NO, wpsg_mod_request::TYP_YESWITHBASKET)))) return false;
-				
-			}
-			
+
+			}
+
 			// Kauf nur fÃŒr angemeldete Benutzer?
 			$wpsg_mod_kundenverwaltung_preisAnzeige = $this->shop->get_option('wpsg_mod_kundenverwaltung_preisAnzeige');
-			
+
 			if (wpsg_isSizedInt($wpsg_mod_kundenverwaltung_preisAnzeige))
 			{
-				
+
 				$isLoggedIn = $this->shop->callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn');
-				
+
 				if (!wpsg_isSizedInt($isLoggedIn)) return false;
-				
-			} 
-			
+
+			}
+
 			// Module Checken
 			$bOK = $this->shop->callMods('canOrder', array($product_key));
-			
+
 			return $bOK;
-			
+
 		} // public function canOrder()
-		
+
 		/**
 		 * Gibt den MwSt. Wert fÃŒr das Frontend zurÃŒck
@@ -331,9 +331,9 @@
 		public function getFrontendTaxValue()
 		{
-			
+
 			return 19.00;
-			
+
 		} // public function getFrontendTaxValue()
-		
+
 		/**
 		 * Gibt den Alten Preis fÃŒr das Frontend zurÃŒck
@@ -341,5 +341,5 @@
 		public function getOldPrice($taxView = false)
 		{
-			
+
 			if ($taxView === false)
 			{
@@ -351,26 +351,26 @@
 
 			$oldprice = wpsg_tf($this->oldprice);
-			
+
 			// Rabatt ÃŒberschreibt die Produkteinstellung
-			if ($this->shop->hasMod('wpsg_mod_discount') && wpsg_isSizedInt($this->shop->get_option('wpsg_mod_discount_show')) && isset($this->loadedData['preis_prediscount'])) 
-			{
-				
+			if ($this->shop->hasMod('wpsg_mod_discount') && wpsg_isSizedInt($this->shop->get_option('wpsg_mod_discount_show')) && isset($this->loadedData['preis_prediscount']))
+			{
+
 				// Rabatt
 				$oldprice = $this->loadedData['preis_prediscount'];
-			 
-			}
-			
+
+			}
+
 			if ($oldprice > 0) return $this->calculateTaxViewPrice($oldprice, $taxView);
 			else return false;
-			
+
 		}
-		
+
 		public function getMinPrice()
 		{
-			
+
 			return $this->getPrice();
-			
+
 		}
-		
+
 		/**
 		 * Gibt den Preis fÃŒr das Frontend zurÃŒck
@@ -386,10 +386,10 @@
 
 			}
-			  
+
 			if ($taxView === WPSG_BRUTTO)
 			{
 
 				$price = $this->loadedData['preis_brutto'];
-				
+
 			}
 			else
@@ -399,28 +399,28 @@
 
 			}
-			 
+
 			return $price;
-			
+
 		}
-		
+
 		/**
 		 * Gibt true zurÃŒck, wenn die Zahlungsarten fÃŒr das Produkt eingeschrÃ€nkt sind
-		 * @return bool 
+		 * @return bool
 		 */
 		public function hasLimitedPayment()
 		{
-			
+
 			$arAllowedPayment = explode(',', $this->allowedpayments);
 			$arAllowedPayment = wpsg_trim($arAllowedPayment, array('', '0'));
-			
+
 			if (wpsg_isSizedArray($arAllowedPayment))
 			{
-				
+
 				return true;
-				
-			}
-			
+
+			}
+
 		} // public function hasLimitedPayment()
-				
+
 		/**
 		 * Gibt einen Array mit IDs von Zahlungsarten zurÃŒck, die fÃŒr dieses Produkt erlaubt sind
@@ -430,17 +430,17 @@
 		public function getAllowedPayment()
 		{
-			
+
 			if (!$this->hasLimitedPayment()) return array();
 			else
 			{
-				
+
 				$arPayment = wpsg_trim((array)explode(',', $this->allowedpayments), '0');
-				
+
 				return $arPayment;
-				
-			}
-			
+
+			}
+
 		} // public function getAllowedPayment()
-		
+
 		/**
 		 * Gibt true zurÃŒck, wenn die Versandarten fÃŒr das Produkt eingeschrÃ€nkt sind
@@ -448,19 +448,19 @@
 		public function hasLimitedShipping()
 		{
-				
+
 			$arAllowedShipping = explode(',', $this->allowedshipping);
 			$arAllowedShipping = wpsg_trim($arAllowedShipping, array('', '0'));
-			
+
 			if (wpsg_isSizedArray($arAllowedShipping))
 			{
-		
+
 				return true;
-		
-			}
-			
+
+			}
+
 			return false;
-				
+
 		} // public function hasLimitedShipping()
-		
+
 		/**
 		 * Gibt einen Array mit IDs von Versandarten zurÃŒck, die fÃŒr dieses Produkt erlaubt sind
@@ -470,15 +470,15 @@
 		public function getAllowedShipping()
 		{
-			
+
 			if (!$this->hasLimitedShipping()) return array();
 			else
 			{
-				
+
 				$arShipping = wpsg_trim((array)explode(',', $this->allowedshipping), '0');
-				
+
 				return $arShipping;
-				
-			}
-			
+
+			}
+
 		} // public function getAllowedShipping()
 
@@ -520,12 +520,12 @@
 
 		}
-		
+
 		/* Statische Funktionen */
-		
+
 		public static function findMaxPrice($arFilter = array())
 		{
-			
+
 			list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = self::getQueryParts($arFilter);
-				
+
 			$strQuery = "
 				SELECT
@@ -541,14 +541,14 @@
 					".$strQueryHAVING."
 			";
-			
+
 			return $GLOBALS['wpsg_db']->fetchOne($strQuery);
-			
+
 		}
-		
+
 		public static function findMinPrice($arFilter = array())
 		{
-		
+
 			list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = self::getQueryParts($arFilter);
-			
+
 			$strQuery = "
 				SELECT
@@ -559,12 +559,12 @@
 				WHERE
 					1
-					".$strQueryWHERE."				
+					".$strQueryWHERE."
 				HAVING
 					1
 					".$strQueryHAVING."
 			";
-					 	
+
 			return $GLOBALS['wpsg_db']->fetchOne($strQuery);
-			
+
 		} // public static function getMinPrice($arFilter = array())
 
@@ -586,11 +586,11 @@
 						WHERE
 							1
-							".$strQueryWHERE." 
+							".$strQueryWHERE."
 						HAVING
 							1
-							".$strQueryHAVING."											
+							".$strQueryHAVING."
 					) AS innerSelect
 			";
- 			
+
 			return $GLOBALS['wpsg_db']->fetchOne($strQuery);
 
@@ -620,44 +620,44 @@
 				HAVING
 					1
-					".$strQueryHAVING."				
+					".$strQueryHAVING."
 				ORDER BY
 					".$strQueryORDER."
 				".$strLimit."
 			";
- 
+
 			$arID = $GLOBALS['wpsg_db']->fetchAssocField($strQuery);
 			$arReturn = array();
-		
+
 			// Manche Filterungen erfordern leider Objektzugriff
 			$force_load = false;
-			
+
 			// Wenn ich die nicht kaufbaren Produkte rausfiltern will, kann ich es nicht auf einen DB Query beschrÃ€nken, da ich die Module anfragen muss
 			//if (wpsg_isSizedInt($arFilter['hideNotBuyable'])) $force_load = true;
-				  			
+
 			foreach ($arID as $id)
 			{
-		
+
 				if ($load === true || $force_load === true)
 				{
-										
+
 					$arReturn[$id] = self::getInstance($id);
-										
-					//if (wpsg_isSizedInt($arFilter['hideNotBuyable']) && !$arReturn[$id]->canOrder()) { unset($arReturn[$id]); continue; } 
-					
+
+					//if (wpsg_isSizedInt($arFilter['hideNotBuyable']) && !$arReturn[$id]->canOrder()) { unset($arReturn[$id]); continue; }
+
 					// StandardmÃ€Ãig werden nicht anzeigbare Produkte ausgeblendet
 					// Erfordert das die Objekt geladen wurden, sonst muss spÃ€ter geprÃŒft werden
-					if (!$arReturn[$id]->canDisplay()) { unset($arReturn[$id]); continue; } 
-					
+					if (!$arReturn[$id]->canDisplay()) { unset($arReturn[$id]); continue; }
+
 					if (isset($arReturn[$id]) && $force_load === true && $load === false) $arReturn[$id] = $id;
-										
+
 				}
 				else $arReturn[$id] = $id;
-		
-			} 
-		
+
+			}
+
 			return $arReturn;
-		
+
 		} // public function find($arQuery = array())
-		
+
 		public static function getQueryParts($arFilter = array())
 		{
@@ -683,5 +683,5 @@
 				if ($GLOBALS['wpsg_sc']->hasMod('wpsg_mod_varianten')) $strQueryWHERE_OR .= " OR `mod_varianten` LIKE '%".wpsg_q($arFilter['s'])."%' ";
 
-				$strQueryWHERE .= " 
+				$strQueryWHERE .= "
 					AND (
 						P.`name` LIKE '%".wpsg_q($arFilter['s'])."%' OR
@@ -695,42 +695,61 @@
 			if (wpsg_isSizedArray($arFilter['cat_ids']) && $GLOBALS['wpsg_sc']->hasMod('wpsg_mod_produktartikel'))
 			{
-				
+
 				$strQueryJOIN .= " LEFT JOIN `".wpsg_q($GLOBALS['wpsg_sc']->prefix.'posts')."` AS POST ON (POST.`wpsg_produkt_id` = P.`id`) ";
 				$strQueryJOIN .= " LEFT JOIN `".wpsg_q($GLOBALS['wpsg_sc']->prefix.'term_relationships')."` AS PCAT ON (POST.`ID` = PCAT.`object_id`) ";
-			
+
 				$strQueryWHERE .= " AND PCAT.`term_taxonomy_id` IN (".wpsg_q(implode(',', $arFilter['cat_ids'])).") ";
-				
-			}
-			
+
+			}
+
+			if ((wpsg_isSizedString($arFilter['productcategory_ids'])) && ($arFilter['productcategory_ids'] != '-1') && ($GLOBALS['wpsg_sc']->hasMod('wpsg_mod_produktartikel')))
+			{
+
+				$strQueryJOIN .= " LEFT JOIN `".wpsg_q($GLOBALS['wpsg_sc']->prefix.'posts')."` AS POST ON (POST.`wpsg_produkt_id` = P.`id`) ";
+				$strQueryJOIN .= " LEFT JOIN `".wpsg_q($GLOBALS['wpsg_sc']->prefix.'term_relationships')."` AS TR ON (POST.`ID` = TR.`object_id`) ";
+
+				$strQueryWHERE .= " AND TR.`term_taxonomy_id` = ".$arFilter['productcategory_ids']." ";
+				/*
+				$strQueryWHERE = " AND P.`lang_parent` <= 0 ";
+				$strQueryHAVING .= "
+					AND (
+						P.`name` LIKE '%".wpsg_q($arFilter['s'])."%' OR
+						P.`anr` LIKE '%".wpsg_q($arFilter['s'])."%'
+					)
+				";
+				*/
+
+			}
+
 			if (wpsg_isSizedArray($arFilter['variants']))
 			{
-								
-				foreach (wpsg_trim($arFilter['variants']) as $variant_id => $variation_id) 
+
+				foreach (wpsg_trim($arFilter['variants']) as $variant_id => $variation_id)
 				{
-									
+
 					$in = wpsg_q($variant_id);
 					$strQueryJOIN .= " RIGHT JOIN `".WPSG_TBL_PRODUCTS_VARIATION."` AS PVI".$in." ON (PVI".$in.".`product_id` = P.`id` AND PVI".$in.".`variation_id` IN (".wpsg_q($variation_id).") AND PVI".$in.".`active` = '1') ";
-										
+
 				}
-				 				
-			}
-			
+
+			}
+
 			if (wpsg_isSizedArray($arFilter['attributs']))
 			{
-				
+
 				foreach ($arFilter['attributs'] as $attribut_id => $attribut_value)
 				{
-					
+
 					$in = wpsg_q($attribut_id);
 					$arValues = wpsg_trim(explode(',', $attribut_value));
-					 
+
 					$strQueryJOIN_ATTRIBUTE_ON  = " ( 0 ";
 					foreach ($arValues as $k => $value) $strQueryJOIN_ATTRIBUTE_ON .= " OR PA".$in.".`value` = '".wpsg_q($value)."' ";
 					$strQueryJOIN_ATTRIBUTE_ON .= " ) ";
-					
+
 					$strQueryJOIN .= " RIGHT JOIN `".WPSG_TBL_PRODUCTS_AT."` AS PA".$in." ON (PA".$in.".`p_id` = P.`id` AND PA".$in.".`a_id` = '".wpsg_q($attribut_id)."' AND ".$strQueryJOIN_ATTRIBUTE_ON.") ";
-					
+
 				}
-				 
+
 			}
 
@@ -752,9 +771,9 @@
 
 			$strQueryWHERE .= " AND P.`deleted` != '1' ";
-			
+
 			return array($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER);
-		
+
 		} // public function getQueryParts($arFilter = array())
-		
+
 	} // class wpsg_product extends wpsg_model
 
Index: /mods/mod_productgroups/wpsg_productgroup.php
===================================================================
--- /mods/mod_productgroups/wpsg_productgroup.php	(revision 6337)
+++ /mods/mod_productgroups/wpsg_productgroup.php	(revision 6338)
@@ -17,11 +17,11 @@
 
 			$this->data = $this->db->fetchRow("
-				SELECT 
+				SELECT
 					PG.*,
-					(SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS."` AS P WHERE P.`pgruppe` = PG.`id`) AS `product_count` 
+					(SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS."` AS P WHERE P.`pgruppe` = PG.`id`) AS `product_count`
 				FROM
 					`".WPSG_TBL_PRODUCTS_GROUP."` AS PG
 				WHERE
-					PG.`id` = '".wpsg_q($productgroup_id)."' 
+					PG.`id` = '".wpsg_q($productgroup_id)."'
 			");
 
@@ -34,24 +34,25 @@
 	    public function countProducts()
 	    {
-		    
+
 		    return $this->product_count;
-		    
+
 	    }
-	    
+
         /* Statische Funktionen */
 
 	    public static function getProductgroupSelect($arProductFilter)
 	    {
-						
+
 			if (wpsg_isSizedArray($arProductFilter))
 			{
-								
+
 				unset($arProductFilter['limit']);
 				unset($arProductFilter['page']);
 				unset($arProductFilter['status']);
 				unset($arProductFilter['productgroup_ids']);
-				
+				unset($arProductFilter['productcategory_ids']);
+
 				list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = wpsg_product::getQueryParts($arProductFilter);
-						 				
+
 				$strQuery = "
 					SELECT
@@ -68,12 +69,12 @@
 					ORDER BY
 						`name` ASC
-				"; 
-				
+				";
+
 				return $GLOBALS['wpsg_db']->fetchAssocField($strQuery, "id", "name");
-				
+
 			}
 			else
 			{
-			
+
 				return $GLOBALS['wpsg_db']->fetchAssocField("
 					SELECT
@@ -89,5 +90,5 @@
 						`name` ASC
 				", "id", "name");
-				
+
 			}
 
@@ -114,8 +115,8 @@
 						WHERE
 							1
-							".$strQueryWHERE." 
+							".$strQueryWHERE."
 						HAVING
 							1
-							".$strQueryHAVING."											
+							".$strQueryHAVING."
 					) AS innerSelect
 			";
@@ -147,5 +148,5 @@
 					".$strQueryHAVING."
 				ORDER BY
-					".$strQueryORDER."		
+					".$strQueryORDER."
 				".$strLimit."
 			";
@@ -171,5 +172,5 @@
 			$strQueryWHERE = "";
 			$strQueryJOIN = "";
-			$strQueryHAVING = ""; 
+			$strQueryHAVING = "";
 
 			if (wpsg_isSizedString($arFilter['order'], 'name')) { $strQueryORDER = " PG.`name` "; }
Index: /mods/wpsg_mod_discount.class.php
===================================================================
--- /mods/wpsg_mod_discount.class.php	(revision 6337)
+++ /mods/wpsg_mod_discount.class.php	(revision 6338)
@@ -4,11 +4,11 @@
 	 * Rabatt Modul
 	 */
-	class wpsg_mod_discount extends wpsg_mod_basic 
+	class wpsg_mod_discount extends wpsg_mod_basic
 	{
-		
-		var $id = 700;		
+
+		var $id = 700;
 		var $lizenz = 1;
 		var $hilfeURL = 'http://wpshopgermany.de/?p=1550';
-		
+
 		/**
 		 * Costructor
@@ -16,69 +16,69 @@
 		public function __construct()
 		{
-			
+
 			parent::__construct();
-			
+
 			$this->name = __('Rabatt', 'wpsg');
 			$this->group = __('Bestellung', 'wpsg');
 			$this->desc = __('Ist dieses Modul aktiv, so lassen sich Rabatte abhÃ€ngig vom Bestellwert vergeben. Der Bestellwert ist der Artikelpreis + Kosten fÃŒr Versandkosten etc.', 'wpsg');
-						
-		} // public function __construct()		
+
+		} // public function __construct()
 
 		public function install()
 		{
-			
+
 			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
-			
+
 			/** Kundengruppentabelle erweitern */
 			$sql = "CREATE TABLE ".WPSG_TBL_KG." (
 				id mediumint(9) NOT NULL AUTO_INCREMENT,
    				discount VARCHAR(255) NOT NULL,
-				PRIMARY KEY  (id)		
+				PRIMARY KEY  (id)
    			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
-				
+
 			dbDelta($sql);
-			
+
 		} // public function install()
-		
-		public function settings_edit() 
-		{
-			
-			$this->shop->view['data'] = $this->getOptionData();			
-			
+
+		public function settings_edit()
+		{
+
+			$this->shop->view['data'] = $this->getOptionData();
+
 			$hierarchie = explode(',', $this->shop->get_option('wpsg_mod_discount_hierarchie'));
 			if (!wpsg_isSizedArray($hierarchie)) $hierarchie = array();
-			
+
 			if (!in_array('general', $hierarchie)) $hierarchie[] = 'general';
 			if (!in_array('product', $hierarchie)) $hierarchie[] = 'product';
 			if (!in_array('productgroup', $hierarchie)) $hierarchie[] = 'productgroup';
 			if (!in_array('customer', $hierarchie)) $hierarchie[] = 'customer';
-			
+
 			$this->shop->view['wpsg_mod_discount']['hierarchie'] = $this->getHierarchie();
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_discount/settings_edit.phtml');
-			
+
 		} // public function settings_edit()
-		
+
 		public function settings_save()
 		{
-			
+
 			$this->shop->update_option('wpsg_mod_discount_productdiscount', $_REQUEST['wpsg_mod_discount_productdiscount']);
 			$this->shop->update_option('wpsg_mod_discount_universal', $_REQUEST['wpsg_mod_discount_universal']);
 			$this->shop->update_option("wpsg_mod_discount_universal_from", $_REQUEST['wpsg_mod_discount_universal_from']);
 			$this->shop->update_option("wpsg_mod_discount_universal_to", $_REQUEST['wpsg_mod_discount_universal_to']);
-			$this->shop->update_option("wpsg_mod_discount_universal_value", wpsg_ff(wpsg_tf($_REQUEST['wpsg_mod_discount_universal_value'], true)));				
+			$this->shop->update_option("wpsg_mod_discount_universal_value", wpsg_ff(wpsg_tf($_REQUEST['wpsg_mod_discount_universal_value'], true)));
 			if ($this->shop->hasMod('wpsg_mod_productgroups')) $this->shop->update_option('wpsg_mod_discount_productgroupdiscount', $_REQUEST['wpsg_mod_discount_productgroupdiscount']);
 			if ($this->shop->hasMod('wpsg_mod_customergroup')) $this->shop->update_option('wpsg_mod_discount_customergroup', $_REQUEST['wpsg_mod_discount_customergroup']);
 			$this->shop->update_option('wpsg_mod_discount_show', $_REQUEST['wpsg_mod_discount_show']);
 			$this->shop->update_option('wpsg_mod_discount_hierarchie', implode(',', $_REQUEST['wpsg_mod_discount_hierarchie']));
-			 
+
 			$data_rabatt = $this->getOptionData();
-		 
+
 			// Den Nullwert speichern
 			$data_rabatt[0]['rabatt'] = wpsg_tf($_REQUEST['value'][0]['rabatt'], true);
 			$data_rabatt[0]['value'] = 0;
-			
+
 			$insert = 0;
-			
+
 			if (wpsg_tf($_REQUEST['neu']['value']) > 0 && wpsg_tf($_REQUEST['neu']['rabatt']) > 0)
 			{
@@ -88,5 +88,5 @@
 					"rabatt" => wpsg_tf($_REQUEST['neu']['rabatt'], true)
 				);
-				 
+
 				$find = false;
 				foreach ($data_rabatt as $k => $v)
@@ -94,82 +94,82 @@
 					if ($v['value'] == $data['value']) $find = $k;
 				}
-				
+
 				if ($find !== false)
 					$data_rabatt[$find] = $data;
 				else
 					$data_rabatt[] = $data;
-				
+
 				$insert = wpsg_tf($_REQUEST['neu']['value']);
-					
+
 				// Felder fÃŒr Formular lÃ¶schen
 				$_REQUEST['neu']['value'] = "";
 				$_REQUEST['neu']['rabatt'] = "";
-																	
+
 			}
 			else if (wpsg_tf($_REQUEST['neu']['value']) > 0 || wpsg_tf($_REQUEST['neu']['rabatt']) > 0)
 			{
-				
+
 				$this->shop->addBackendError(__("Bitte einen gÃŒltigen Bestellwert und einen Rabatt eingeben!", "wpsg"));
-				
-			}
- 
+
+			}
+
 			foreach ($_REQUEST['value'] as $k => $v)
 			{
-				
+
 				$find = false;
 				foreach ($data_rabatt as $k2 => $v2)
-				{ 			
+				{
 					$vval = wpsg_getInt($v['value']);
 					$v2val = wpsg_getInt($v2['value']);
-						
+
 					if (	wpsg_tf($v2val) == wpsg_tf($vval) &&
-							wpsg_tf($v2val) != $insert	) 
-					{
-						 
+							wpsg_tf($v2val) != $insert	)
+					{
+
 						$find = $k2;
-						
-					}
-				}
-			 			
+
+					}
+				}
+
 				if ($find !== false)
-				{  
+				{
 					$vdel = wpsg_getInt($v['del']);
 					if ($vdel == 1) unset($data_rabatt[$find]);
 					else $data_rabatt[$find]['rabatt'] = wpsg_tf($v['rabatt'], true);
 				}
-				
-			}
- 
+
+			}
+
 			$this->shop->update_option("wpsg_mod_discount_data", serialize($data_rabatt));
-			 
+
 			$this->shop->update_option('wpsg_mod_discount_stopRabatt', $_REQUEST['wpsg_mod_discount_stopRabatt']);
-			
-			$this->shop->update_option('wpsg_mod_discount_showBasket', $_REQUEST['wpsg_mod_discount_showBasket']); 
-			
+
+			$this->shop->update_option('wpsg_mod_discount_showBasket', $_REQUEST['wpsg_mod_discount_showBasket']);
+
 		} // public function settings_save()
-				
+
 		public function product_addedit_content(&$product_content, &$product_data)
 		{
-		
+
 			if (wpsg_isSizedInt($product_data['id']))
 			{
-					
+
 				if (isset($_REQUEST['wpsg_lang'])) return;
-			
+
 				$this->shop->view['wpsg_mod_discount']['data'] = explode("_", $product_data['rabatt']);
-			
-			}
-		
+
+			}
+
 			/*$product_content['wpsg_mod_discount'] = array(
 					'title' => __('Rabatte', 'wpsg'),
 					'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_discount/produkt_addedit_sidebar.phtml', false)
 			);*/
-			
+
 			if (isset($product_content['price']['content']))
 				$product_content['price']['content'] .= $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_discount/produkt_addedit_sidebar.phtml', false);
-				
-		
+
+
 		} // public function produkt_edit_sidebar(&$product_content, &$produkt_data)
-		
+
 		/**
 		 * Soll den Rabattierten Preis zurÃŒckgeben
@@ -179,142 +179,142 @@
 		public function getDiscountPrice($product_id, $price)
 		{
-			
-			$arDiscountTypes = $this->getHierarchie(); 
-				
+
+			$arDiscountTypes = $this->getHierarchie();
+
 			if (wpsg_isSizedArray($arDiscountTypes))
 			{
-			
+
 				foreach ($arDiscountTypes as $discount_type)
 				{
-						
+
 					$discount_value = false;
-						
+
 					if ($discount_type == 'product' && $this->hasProductDiscount($product_id))
 					{
-			
+
 						$discount_value = $this->getProductDiscount($product_id);
-							
+
 					}
 					else if ($discount_type == 'productgroup' && $this->hasProductgroupDiscount($product_id))
 					{
-			
+
 						$discount_value = $this->getProductgroupDiscount($product_id);
-							
+
 					}
 					else if ($discount_type == 'general' && $this->hasGeneralProductdiscount())
 					{
-			
+
 						$discount_value = $this->getGeneralProductdiscount();
-							
+
 					}
 					else if ($discount_type == 'customer' && $this->hasCustomergroupRabatt())
 					{
-			
+
 						$discount_value = $this->getCustomergroupRabatt();
-			
-					}
-			
+
+					}
+
 					if (wpsg_tf($discount_value) > 0)
 					{
-			
+
 						//$this->applyDiscountToProductData($discount_value, $product_data, $discount_type);
 						if (strpos($discount_value, "%") !== false)
 						{
-							
+
 							$price -= ($price * wpsg_tf($discount_value) / 100);
-							
+
 						}
 						else
 						{
-							
+
 							$price -= wpsg_tf($discount_value);
-							
+
 						}
-							
+
 						if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_discount_stopRabatt'))) break;
-			
-					}
-			
-				}
-			
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			return $price;
-			
+
 		} // public function getDiscountPrice($product_id, $price)
-		
+
 		public function loadProduktArray(&$product_data)
 		{
-						
+
 			$arDiscountTypes = $this->getHierarchie();
 			$produkt_id = $this->shop->getProduktId($product_data['id']);
-			
+
 			if (wpsg_isSizedArray($arDiscountTypes))
 			{
-				
+
 				foreach ($arDiscountTypes as $discount_type)
 				{
-					
-					$discount_value = false; 
-					
+
+					$discount_value = false;
+
 					if ($discount_type == 'product' && $this->hasProductDiscount($produkt_id))
 					{
-						
+
 						$discount_value = $this->getProductDiscount($produkt_id);
-						 
-					}
-					else if ($discount_type == 'productgroup' && $this->hasProductgroupDiscount($produkt_id)) 
-					{
-						
+
+					}
+					else if ($discount_type == 'productgroup' && $this->hasProductgroupDiscount($produkt_id))
+					{
+
 						$discount_value = $this->getProductgroupDiscount($produkt_id);
-						 
-					}
-					else if ($discount_type == 'general' && $this->hasGeneralProductdiscount()) 
-					{
-						
+
+					}
+					else if ($discount_type == 'general' && $this->hasGeneralProductdiscount())
+					{
+
 						$discount_value = $this->getGeneralProductdiscount();
-						 
-					}
-					else if ($discount_type == 'customer' && $this->hasCustomergroupRabatt()) 
-					{
-						
+
+					}
+					else if ($discount_type == 'customer' && $this->hasCustomergroupRabatt())
+					{
+
 						$discount_value = $this->getCustomergroupRabatt();
-						
-					}
-					 
+
+					}
+
 					if (wpsg_tf($discount_value) > 0)
 					{
-						  
+
 						$this->applyDiscountToProductData($discount_value, $product_data, $discount_type);
-					
+
 						if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_discount_stopRabatt'))) break;
-						
-					}
-										
-				}
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 			if ($product_data['preis'] < 0) $product_data['preis'] = 0;
 			if ($product_data['preis_brutto'] < 0) $product_data['preis_brutto'] = 0;
 			if ($product_data['preis_netto'] < 0) $product_data['preis_netto'] = 0;
- 			
+
 			//wpsg_debug("Rabatt:loadProduktArray = ".$product_data['preis']);
-			
+
 		} // public function loadProduktArray(&$produkt_data)
-				
-		public function wpsg_mod_productgroups_addedit_sidebar(&$productgroupdata) 
-		{ 
-			 
-			$this->shop->view['wpsg_mod_discount']['data'] = explode("_", $productgroupdata['rabatt']);			
-			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_discount/productgroups_addedit_sidebar.phtml');	
-			
+
+		public function wpsg_mod_productgroups_addedit_sidebar(&$productgroupdata)
+		{
+
+			$this->shop->view['wpsg_mod_discount']['data'] = explode("_", wpsg_getStr($productgroupdata['rabatt']));
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_discount/productgroups_addedit_sidebar.phtml');
+
 		} // public function wpsg_mod_productgroups_addedit_sidebar(&$productgroupdata)
-		
+
 		public function wpsg_mod_productgroups_save($productgroup_id)
 		{
-			
+
 			$rabatt = "";
-			
+
 			/**
 			 * Ich speichere die Rabatteinstellungen in einem Feld innerhalb der Produktgruppe das Trennzeichen ist "_"
@@ -325,12 +325,12 @@
 				'rabatt' => wpsg_q($rabatt_str)
 			), "`id` = '".wpsg_q($productgroup_id)."'");
-			
+
 		} // public function wpsg_mod_productgroups_save($productgroup_id)
-		
+
 		public function produkt_save(&$produkt_id)
 		{
-			
+
 			$rabatt = "";
-			
+
 			/**
 			 * Ich speichere die Rabatteinstellungen in einem Feld innerhalb des Produktes das Trennzeichen ist "_"
@@ -338,112 +338,112 @@
 			if (isset($_REQUEST['wpsg_mod_discount']))
 				$rabatt_str = $_REQUEST['wpsg_mod_discount']['discount_aktiv']."_".$_REQUEST['wpsg_mod_discount']['discount_from']."_".$_REQUEST['wpsg_mod_discount']['discount_to']."_".wpsg_tf($_REQUEST['wpsg_mod_discount']['discount_value'], true);
-			
+
 			$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, array(
 				'rabatt' => wpsg_q(wpsg_getStr($rabatt_str))
 			), "`id` = '".wpsg_q($produkt_id)."'");
-			
+
 		} // public function produkt_save($produkt_id)
-		
+
 		public function customergroup_edit(&$oCustomergroup)
 		{
-			
+
 			$this->shop->view['wpsg_mod_discount']['discount'] = wpsg_getStr($oCustomergroup->data['discount']);
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'mods/mod_discount/customergroup_edit.phtml');
-			
+
 		} // public function customergroup_edit(&$customergroup_id)
-		
+
 		public function customergroup_save(&$customergroup_id)
 		{
-			
+
 			$this->db->UpdateQuery(WPSG_TBL_KG, array(
 				'discount' => wpsg_q($_REQUEST['wpsg_mod_discount']['discount'])
 			), " `id` = '".wpsg_q($customergroup_id)."' ");
-			
+
 		} // public function customergroup_save(&$customergroup_id)
-						
-		public function addDiscountToVari(&$product_id, &$varianten_data) 
-		{ 
-			 
+
+		public function addDiscountToVari(&$product_id, &$varianten_data)
+		{
+
 			$arDiscountTypes = $this->getHierarchie();
-				
+
 			if (wpsg_isSizedArray($arDiscountTypes))
 			{
-			
+
 				foreach ($arDiscountTypes as $discount_type)
 				{
-						
+
 					$discount_value = false;
-						
+
 					if ($discount_type == 'product' && $this->hasProductDiscount($product_id))
 					{
-			
+
 						$discount_value = $this->getProductDiscount($product_id);
-							
+
 					}
 					else if ($discount_type == 'productgroup' && $this->hasProductgroupDiscount($product_id))
 					{
-			
+
 						$discount_value = $this->getProductgroupDiscount($product_id);
-							
+
 					}
 					else if ($discount_type == 'general' && $this->hasGeneralProductdiscount())
 					{
-			
+
 						$discount_value = $this->getGeneralProductdiscount();
-							
+
 					}
 					else if ($discount_type == 'customer' && $this->hasCustomergroupRabatt())
 					{
-			
+
 						$discount_value = $this->getCustomergroupRabatt();
-			
-					}
-						
+
+					}
+
 					if (wpsg_tf($discount_value) > 0)
 					{
-						 
+
 						$this->applyDiscountToVariData($discount_value, $varianten_data, $discount_type);
-							
+
 						if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_discount_stopRabatt'))) break;
-			
-					}
-			
-				}
-			
-			}
-			
+
+					}
+
+				}
+
+			}
+
 		} // public function addDiscountToVari(&$product_id, &$varianten_data)
-		
-		public function basket_top() 
-		{ 
-			
+
+		public function basket_top()
+		{
+
 			if (!wpsg_isSizedInt($this->shop->get_option('wpsg_mod_discount_showBasket'))) return false;
-			
+
 			$nextBasketDiscount = $this->getNextBasketDiscount();
-			
+
 			if ($nextBasketDiscount === false) return false;
-						
+
 			$this->shop->view['wpsg_mod_discount']['discount'] = $nextBasketDiscount['discount'];
 			$this->shop->view['wpsg_mod_discount']['value'] = $nextBasketDiscount['value'];
 			$this->shop->view['wpsg_mod_discount']['discountdifference'] = $nextBasketDiscount['discountdifference'];
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_discount/basket_top.phtml');
-			
+
 		} // public function basket_top()
-		
+
 		/* Modulfunktionen */
-		
+
 		private function cmp($a, $b)
 		{
 			$aval = wpsg_getInt($a['value']);
 			$bval = wpsg_getInt($b['value']);
-				
+
 			if ($a['value'] == $b['value']) return 0;
-			 
+
 			return ($a['value'] < $b['value']) ? -1 : 1;
-		
+
 		} // private function cmp($a, $b)
-		 
+
 		/**
 		 * Gibt den nÃ€chsten Rabatt und den dafÃŒr nÃ¶tigen Warenkorbwert zurÃŒck
@@ -452,61 +452,61 @@
 		public function getNextBasketDiscount()
 		{
-			
+
 			$data_rabatt = $this->getOptionData();
-			
+
 			if (!wpsg_isSizedArray($data_rabatt)) return false;
-			
+
 			$arBasket = $this->shop->basket->toArray();
 			$basket_amount_brutto = wpsg_getFloat($arBasket['sum']['preis_gesamt_brutto']) + wpsg_getFloat($arBasket['sum']['preis_rabatt_brutto']);
-			
+
 			if ($basket_amount_brutto <= 0) return false;
-			
+
 			foreach ($data_rabatt as $k => $discount)
 			{
-			
+
 				if (isset($discount['value']) && $discount['value'] > $basket_amount_brutto)
 				{
-					
+
 					return array(
-						'discount' => $discount['rabatt'], 
+						'discount' => $discount['rabatt'],
 						'value' => $discount['value'],
 						'discountdifference' => abs($basket_amount_brutto - $discount['value'])
-					); 
-					
-				}
-				
-			}
-			 
+					);
+
+				}
+
+			}
+
 			return false;
-			
+
 		} // public function getNextBasketDiscount()
-		
+
 		/**
 		 * Rabatt in Warenkorb einrechnen
 		 */
-		public function basket_toArray_discount(&$basket, &$arReturn) 
-		{ 
-		
+		public function basket_toArray_discount(&$basket, &$arReturn)
+		{
+
 			// Analog Gutschein, fÃŒr den Warenkorbrabatt
-			
+
 			$data_rabatt = $this->getOptionData();
 			$discount = false;
 			$discount_tax = 0;
-			
+
 			$value = $arReturn['sum']['preis_gesamt_brutto'];
 			if ($value == 0) return;
-			
-			
-			
+
+
+
 			foreach ((array)$data_rabatt as $k => $v)
 			{
-				
+
 				if (!isset($v['value']) || $value >= $v['value']  && wpsg_tf($v['rabatt']) > 0)
 				{
-					
-					$discount = $v['rabatt']; 
-					
-				}				
-				
+
+					$discount = $v['rabatt'];
+
+				}
+
 			}
 
@@ -521,8 +521,8 @@
 				if ($price_option == WPSG_BRUTTO)
 				{
-						
+
 					if ($this->shop->get_option('wpsg_kleinunternehmer') != '1')
 					{
-					
+
 						// Rabatt auf die verschiedenen Produkte aufteilen.
 						//$discount_tax = $this->shop->addMwSt($arReturn, $discount);
@@ -530,49 +530,49 @@
 
 					}
-						
+
 					if ($this->shop->addRoundedValues === true)
 					{
-					
+
 						$discount_brutto = round($discount_brutto, 2);
 						$discount_netto = round($discount_brutto - $discount_tax, 2);
-					
+
 					}
 					else
 					{
-					
+
 						$discount_brutto = $discount_brutto;
 						$discount_netto = $discount_brutto - $discount_tax;
-					
-					}
-						
+
+					}
+
 				}
 				else	// if ($price_option == WPSG_BRUTTO)
 				{
-						
+
 					if ($this->shop->get_option('wpsg_kleinunternehmer') != '1')
 					{
-			
+
 						$discount_tax = $this->shop->addMwSt($arReturn, $discount_netto);
-						
-					}
-						
+
+					}
+
 					if ($this->shop->addRoundedValues === true)
 					{
-					
+
 						$discount_brutto = round($discount_netto + $discount_tax, 2);
 						//$discount_netto = round($discount_value - $discount_tax, 2);
-					
+
 					}
 					else
 					{
-					
+
 						//$discount_brutto = $discount_value;
 						$discount_netto = $discount_brutto - $discount_tax;
-					
+
 					}
 
 				}	// else if ($price_option == WPSG_BRUTTO)
-				
-				
+
+
 				$arReturn['sum']['preis_brutto'] -= $discount_brutto;
 				$arReturn['sum']['preis_netto'] -= $discount_netto;
@@ -581,93 +581,93 @@
 				$arReturn['sum']['preis_rabatt_netto'] = $discount_netto;
 				$arReturn['sum']['preis_rabatt_brutto'] = $discount_brutto;
-				
+
 				if ($this->shop->getFrontendTaxview() == WPSG_NETTO)
 				{
-				
+
 					$arReturn['sum']['preis_rabatt'] = $discount_netto;
 					$arReturn['sum']['preis'] = $arReturn['sum']['preis_netto'];
 					$arReturn['sum']['preis_gesamt'] = $arReturn['sum']['preis_gesamt_netto'];
-						
+
 				}
 				else if ($this->shop->getFrontendTaxview() == WPSG_BRUTTO)
 				{
-						
+
 					$arReturn['sum']['preis_rabatt'] = $discount_brutto;
 					$arReturn['sum']['preis'] = $arReturn['sum']['preis_brutto'];
 					$arReturn['sum']['preis_gesamt'] = $arReturn['sum']['preis_gesamt_brutto'];
-						
-				}
-				
-				
-			
+
+				}
+
+
+
 			}
 			else	// if ($arReturn['backend'] == true)
 			{
-				
+
 				if ($discount !== false)
 				{
-						
+
 					$discount = wpsg_tf($discount, true);
-				
+
 					if (strpos($discount, "%") !== false)
 					{
-							
+
 						$discount_value = $arReturn['sum']['preis_gesamt_brutto'] / 100 * wpsg_tf($discount);
-							
+
 						if ($this->shop->get_option('wpsg_kleinunternehmer') != '1')
 						{
-				
+
 							$discount_tax = $this->shop->subMwSt($arReturn, $discount_value);
-				
+
 						}
-							
+
 					}
 					else if ($discount)
 					{
-							
+
 						if ($this->shop->get_option('wpsg_preisangaben') == WPSG_NETTO)
 						{
-				
+
 							if ($this->shop->get_option('wpsg_kleinunternehmer') != '1')
 							{
-				
+
 								$discount_tax = $this->shop->addMwSt($arReturn, $discount);
-				
+
 							}
-				
+
 							$discount_value = $discount + $discount_tax;
-				
+
 						}
 						else
 						{
-				
+
 							$discount_value = $discount;
-				
+
 							if ($this->shop->get_option('wpsg_kleinunternehmer') != '1')
 							{
-									
+
 								$discount_tax = $this->shop->subMwSt($arReturn, $discount);
-				
+
 							}
-								
+
 						}
-							
-					}
-				
+
+					}
+
 					if ($this->shop->addRoundedValues === true)
 					{
-							
+
 						$discount_brutto = round($discount_value, 2);
 						$discount_netto = round($discount_value - $discount_tax, 2);
-							
+
 					}
 					else
 					{
-					
+
 						$discount_brutto = $discount_value;
 						$discount_netto = $discount_value - $discount_tax;
-							
-					}
-					
+
+					}
+
 					$arReturn['sum']['preis_brutto'] -= $discount_brutto;
 					$arReturn['sum']['preis_netto'] -= $discount_netto;
@@ -676,22 +676,22 @@
 					$arReturn['sum']['preis_rabatt_netto'] = $discount_netto;
 					$arReturn['sum']['preis_rabatt_brutto'] = $discount_brutto;
-					
+
 					if ($this->shop->getFrontendTaxview() == WPSG_NETTO)
 					{
-					
+
 						$arReturn['sum']['preis_rabatt'] = $discount_netto;
 						$arReturn['sum']['preis'] = $arReturn['sum']['preis_netto'];
 						$arReturn['sum']['preis_gesamt'] = $arReturn['sum']['preis_gesamt_netto'];
-							
+
 					}
 					else if ($this->shop->getFrontendTaxview() == WPSG_BRUTTO)
 					{
-							
+
 						$arReturn['sum']['preis_rabatt'] = $discount_brutto;
 						$arReturn['sum']['preis'] = $arReturn['sum']['preis_brutto'];
 						$arReturn['sum']['preis_gesamt'] = $arReturn['sum']['preis_gesamt_brutto'];
-							
-					}
-						
+
+					}
+
 				}
 			}  // else if ($arReturn['backend'] == true)
@@ -699,20 +699,20 @@
 			if ($discount !== false)
 			{
-				
+
 				if ($this->shop->addRoundedValues === true)
 				{
-					
+
 					$discount_brutto = round($discount_value, 2);
 					$discount_netto = round($discount_value - $discount_tax, 2);
-					
-				}
-				else 
-				{
-				
+
+				}
+				else
+				{
+
 					$discount_brutto = $discount_value;
 					$discount_netto = $discount_value - $discount_tax;
-					
-				}
-				  
+
+				}
+
 				$arReturn['sum']['preis_brutto'] -= $discount_brutto;
 				$arReturn['sum']['preis_netto'] -= $discount_netto;
@@ -720,27 +720,27 @@
 				$arReturn['sum']['preis_gesamt_netto'] -= $discount_netto;
 				$arReturn['sum']['preis_rabatt_netto'] = $discount_netto;
-				$arReturn['sum']['preis_rabatt_brutto'] = $discount_brutto;								
-				
+				$arReturn['sum']['preis_rabatt_brutto'] = $discount_brutto;
+
 				if ($this->shop->getFrontendTaxview() == WPSG_NETTO)
 				{
 
-					$arReturn['sum']['preis_rabatt'] = $discount_netto; 
+					$arReturn['sum']['preis_rabatt'] = $discount_netto;
 					$arReturn['sum']['preis'] = $arReturn['sum']['preis_netto'];
 					$arReturn['sum']['preis_gesamt'] = $arReturn['sum']['preis_gesamt_netto'];
-					
+
 				}
 				else if ($this->shop->getFrontendTaxview() == WPSG_BRUTTO)
 				{
-					
-					$arReturn['sum']['preis_rabatt'] = $discount_brutto;					
+
+					$arReturn['sum']['preis_rabatt'] = $discount_brutto;
 					$arReturn['sum']['preis'] = $arReturn['sum']['preis_brutto'];
 					$arReturn['sum']['preis_gesamt'] = $arReturn['sum']['preis_gesamt_brutto'];
-					
-				} 
-				
-			}	*/	
-			
+
+				}
+
+			}	*/
+
 		} // public function basket_toArray_discount(&$basket, &$arBasket)
-		
+
 		/**
 		 * Bearbeitet den Varianten Array und fÃŒgt die rabattierten Preise hinzu
@@ -748,35 +748,35 @@
 		public function applyDiscountToVariData($discount_value, &$varianten_data, $discount_type)
 		{
-			
+
 			if (strpos($discount_value, '%') !== false)
 			{
-				
+
 				foreach ($varianten_data as $var_key => &$var)
 				{
-					
+
 					if ($var['typ'] == 'checkbox')
 					{
-						
+
 						$var['preis'] -= ($var['preis'] * wpsg_tf($discount_value) / 100);
-						
+
 					}
 					else
 					{
-						
+
 						foreach ($var['arVariation'] as $vari_key => &$vari)
 						{
-							
+
 							$vari['preis'] -= ($vari['preis'] * wpsg_tf($discount_value) / 100);
-							
+
 						}
-						
-					}
-					
-				} 
-				
-			}
-			
+
+					}
+
+				}
+
+			}
+
 		} // public function applyDiscountToVariData($discount_value, &$varianten_data, $discount_type)
-		
+
 		/**
 		 * Bearbeitet einen Array mit Produktinformationen mit dem Rabatt
@@ -784,12 +784,12 @@
 		public function applyDiscountToProductData($discount_value, &$product_data, $discount_type)
 		{
-			 
+
 			$mwst_value = $product_data['mwst_value'];
-							
+
 			if (!wpsg_isSizedArray($product_data['discount'])) $product_data['discount'] = array();
 			$product_data['discount'][$discount_type] = $discount_value;
-			
-			$discount_min_price = false; if ($this->shop->hasMod('wpsg_mod_productvariants') && isset($product_data['min_preis'])) $discount_min_price = &$product_data['min_preis']; 
-			$discount_max_price = false; if ($this->shop->hasMod('wpsg_mod_productvariants') && isset($product_data['max_preis'])) $discount_max_price = &$product_data['max_preis']; 
+
+			$discount_min_price = false; if ($this->shop->hasMod('wpsg_mod_productvariants') && isset($product_data['min_preis'])) $discount_min_price = &$product_data['min_preis'];
+			$discount_max_price = false; if ($this->shop->hasMod('wpsg_mod_productvariants') && isset($product_data['max_preis'])) $discount_max_price = &$product_data['max_preis'];
 
 			if (!isset($product_data['preis_prediscount'])) $product_data['preis_prediscount'] = $product_data['preis'];
@@ -799,12 +799,12 @@
 			if ($discount_min_price && !isset($product_data['min_preis_prediscount'])) $product_data['min_preis_prediscount'] = $product_data['min_preis'];
 			if ($discount_max_price && !isset($product_data['max_preis_prediscount'])) $product_data['max_preis_prediscount'] = $product_data['max_preis'];
-			
+
 			if ($this->shop->getBackendTaxview() == WPSG_BRUTTO)
 			{
-				
+
 				$preis_discount_calc = &$product_data['preis_brutto'];
-				$preis_calc = &$product_data['preis_netto'];				
+				$preis_calc = &$product_data['preis_netto'];
 				$calc = WPSG_NETTO;
-				
+
 			}
 			else
@@ -812,50 +812,50 @@
 
 				$preis_discount_calc = &$product_data['preis_netto'];
-				$preis_calc = &$product_data['preis_brutto'];				
+				$preis_calc = &$product_data['preis_brutto'];
 				$calc = WPSG_BRUTTO;
-				
-			}
-			
+
+			}
+
 			if (strpos($discount_value, '%') !== false)
 			{
-				
+
 				$preis_discount_calc = $preis_discount_calc - ($preis_discount_calc * wpsg_tf($discount_value) / 100);
 				if ($discount_min_price) $discount_min_price = $discount_min_price - ($discount_min_price * $discount_value / 100);
 				if ($discount_max_price) $discount_max_price = $discount_max_price - ($discount_max_price * $discount_value / 100);
-				
+
 			}
 			else
 			{
-				
+
 				$preis_discount_calc = $preis_discount_calc = $preis_discount_calc - $discount_value;
 				if ($discount_min_price) $discount_min_price = $discount_min_price - $discount_value;
 				if ($discount_max_price) $discount_max_price = $discount_max_price - $discount_value;
-				
-			}
-			
+
+			}
+
 			// Ich lasse hier negative Discounts zu, da diese spÃ€ter noch vom Variantenmodul abgezogen werden
 			//if ($preis_discount_calc < 0) $preis_discount_calc = 0;
-			
+
 			$preis_calc = wpsg_calculatePreis($preis_discount_calc, $calc, $mwst_value);
-			
+
 			// Preis fÃŒr Anzeige wieder setzen
 			if ($this->shop->getFrontendTaxview() == WPSG_BRUTTO)
 			{
-			
+
 				$product_data['preis'] = &$product_data['preis_brutto'];
-							
+
 			}
 			else
 			{
-			
+
 				$product_data['preis'] = &$product_data['preis_netto'];
-			
-			}
-			
+
+			}
+
 			// Rabattwert eintragen
-			$product_data['discount_value'] = $product_data['preis_prediscount'] - $product_data['preis'];  
-			 
+			$product_data['discount_value'] = $product_data['preis_prediscount'] - $product_data['preis'];
+
 		} // public function applyDiscountToProductData($discount_value, &$product_data)
-		
+
 		/**
 		 * Gibt true zurÃŒck, sofern das Produkt einen aktiven Produktrabatt hat
@@ -863,56 +863,56 @@
 		public function hasProductDiscount($product_id)
 		{
-			
+
 			/**
 			 * Jetzt noch ein eventueller Rabatt aus den Produkten
 			 */
 			$bRabatt_produkt = false;
-			
+
 			if ($this->shop->get_option("wpsg_mod_discount_productdiscount") != "1")
 			{
-				
+
 				$bRabatt_produkt = false;
-				
+
 			}
 			else
 			{
-				
+
 				$product_data = $this->shop->cache->loadProduct($product_id);
 				$discount = explode('_', $product_data['rabatt']);
-			 
+
 				// Zeitraum und gÃŒltigen Wert ÃŒberprÃŒfen
 				if ($discount[0] != "1" || !preg_match("/\d{2}\.\d{2}\.\d{4}/", $discount[1]) || !preg_match("/\d{2}\.\d{2}\.\d{4}/", $discount[2]) || !is_float((float)$discount[3]))
 				{
-					
+
 					$bRabatt_produkt = false;
-					
+
 				}
 				else
 				{
-				 			
+
 					$rabatt_value = $discount[3];
 					$rabatt_start = strtotime($discount[1]);
 					$rabatt_end = strtotime($discount[2]);
-						
+
 					// im Zeitrahmen?
 					if (time() >= $rabatt_start && time() <= $rabatt_end)
 					{
-				
+
 						$bRabatt_produkt = true;
-				
+
 					}
 					else
 					{
-						
+
 						$bRabatt_produkt = false;
-						
-					}
-						
-				}
-
-			}
-				
+
+					}
+
+				}
+
+			}
+
 			return $bRabatt_produkt;
-			
+
 		} // public function hasProductDiscount($product_id)
 
@@ -922,12 +922,12 @@
 		public function getProductDiscount($product_id)
 		{
-			
+
 			if (!$this->hasProductDiscount($product_id)) return 0;
-			
+
 			$product_data = $this->shop->cache->loadProduct($product_id);
 			$discount = explode('_', $product_data['rabatt']);
-			
+
 			return $discount[3];
-			
+
 		} // public function getProductDiscount($product_id)
 
@@ -937,28 +937,28 @@
 		public function hasCustomergroupRabatt()
 		{
-			
+
 			if ($this->shop->hasMod('wpsg_mod_customergroup') && $this->shop->get_option('wpsg_mod_discount_customergroup') === '1')
 			{
-			
+
 				$act_customer_group = $this->shop->callMod('wpsg_mod_kundenverwaltung', 'getCustomerGroup');
-			
+
 				if (wpsg_isSizedInt($act_customer_group))
 				{
-			
+
 					$oCustomerGroup = wpsg_customergroup::getInstance($act_customer_group);
-					
+
 					if ($oCustomerGroup !== false && wpsg_isSizedString($oCustomerGroup->discount))
 					{
-			
+
 						return true;
-			
-					}
-			
-				}
-			
-			}
-				
+
+					}
+
+				}
+
+			}
+
 		} // public function hasCustomergroupRabatt()
-		
+
 		/**
 		 * Gibt den Rabatt aus der Kundengruppe zurÃŒck
@@ -966,27 +966,27 @@
 		public function getCustomergroupRabatt()
 		{
-			
+
 			if (!$this->hasCustomergroupRabatt()) return 0;
-			
+
 			$act_customer_group = $this->shop->callMod('wpsg_mod_kundenverwaltung', 'getCustomerGroup');
-			
+
 			if (wpsg_isSizedInt($act_customer_group))
 			{
-					
+
 				$oCustomerGroup = wpsg_customergroup::getInstance($act_customer_group);
-					
+
 				if ($oCustomerGroup !== false && wpsg_isSizedString($oCustomerGroup->discount))
 				{
-						
+
 					return $oCustomerGroup->discount;
-						
-				}
-					
-			}
-			
+
+				}
+
+			}
+
 			return 0;
-			
+
 		} // public function getCustomergroupRabatt()
-		
+
 		/**
 		 * Gibt true zurÃŒck, sofern das Produkt einen aktiven Rabatt aus dem generellen Produktrabatt hat
@@ -994,12 +994,12 @@
 		public function hasGeneralProductdiscount()
 		{
-			
+
 			$bRabatt_allgemein = true;
-			
+
 			if ($this->shop->get_option("wpsg_mod_discount_universal") != "1")
 			{
 				$bRabatt_allgemein = false;
 			}
-			
+
 			// Genereller Rabatt ist aktiviert nun den Zeitraum ÃŒberprÃŒfen dazu ÃŒberprÃŒf ich zuerst ob die Datumseingaben valide sind
 			if (!preg_match("/\d{2}\.\d{2}\.\d{4}/", $this->shop->get_option("wpsg_mod_discount_universal_from")) ||
@@ -1009,32 +1009,32 @@
 				$bRabatt_allgemein = false;
 			}
-			
+
 			if ($bRabatt_allgemein)
 			{
-			
+
 				$rabatt_value = $this->shop->get_option("wpsg_mod_discount_universal_value");
 				$rabatt_start = strtotime($this->shop->get_option("wpsg_mod_discount_universal_from"));
 				$rabatt_end = strtotime($this->shop->get_option("wpsg_mod_discount_universal_to"));
-					
+
 				// im Zeitrahmen?
 				if (time() >= $rabatt_start && time() <= $rabatt_end)
 				{
-			
+
 					$bRabatt_allgemein = true;
-					 
+
 				}
 				else
 				{
-					
+
 					$bRabatt_allgemein = false;
-					
-				}
-			
-			}
-			
+
+				}
+
+			}
+
 			return $bRabatt_allgemein;
-			
+
 		} // public function hasGeneralProductdiscount()
-		
+
 		/**
 		 * Gibt den generellen Produktrabatt zurÃŒck
@@ -1042,11 +1042,11 @@
 		public function getGeneralProductdiscount()
 		{
-			
+
 			if (!$this->hasGeneralProductdiscount()) return 0;
-			
+
 			return $this->shop->get_option("wpsg_mod_discount_universal_value");
-			
+
 		} // public function getGeneralProductdiscount()
-		
+
 		/**
 		 * Gibt true zurÃŒck, sofern das Produkt einen aktiven Rabatt aus der Produktgruppe hat
@@ -1054,20 +1054,20 @@
 		public function hasProductgroupDiscount($product_id)
 		{
-			
+
 			if (!$this->shop->hasMod('wpsg_mod_productgroups')) return false;
-			
+
 			$bRabatt_produktgruppen = true;
-			
+
 			$rabatt = array();
-			
+
 			if ($this->shop->get_option("wpsg_mod_discount_productgroupdiscount") != "1")
 			{
-				
+
 				$bRabatt_produktgruppen = false;
-				
+
 			}
 			else
 			{
-			
+
 				// Jetzt brauch ich fÃŒr weiter Kontrollen den Rabatt aus der Produkgruppe
 				$rabatt_produktgruppe = $this->db->fetchOne("
@@ -1080,42 +1080,42 @@
 						P.`id` = '".wpsg_q($product_id)."'
 				");
-			
+
 				$rabatt = explode("_", $rabatt_produktgruppe);
-			
-			}
-				
-			// Zeitraum und gÃŒltigen Wert ÃŒberprÃŒfen 
+
+			}
+
+			// Zeitraum und gÃŒltigen Wert ÃŒberprÃŒfen
 			if (!wpsg_isSizedArray($rabatt) || $rabatt[0] != "1" || !preg_match("/\d{2}\.\d{2}\.\d{4}/", $rabatt[1]) || !preg_match("/\d{2}\.\d{2}\.\d{4}/", $rabatt[2]) || !is_float((float)$rabatt[3]))
 			{
-				
+
 				$bRabatt_produktgruppen = false;
-				
-			}
-			
+
+			}
+
 			if ($bRabatt_produktgruppen)
 			{
-			
+
 				$rabatt_value = $rabatt[3];
 				$rabatt_start = strtotime($rabatt[1]);
 				$rabatt_end = strtotime($rabatt[2]);
-			
+
 				// im Zeitrahmen?
 				if (time() >= $rabatt_start && time() <= $rabatt_end)
 				{
-			
+
 					$bRabatt_produktgruppen = true;
-			
+
 				}
 				else
 				{
-					
+
 					$bRabatt_produktgruppen = false;
-					
-				}
-			
-			}
-			
+
+				}
+
+			}
+
 			return $bRabatt_produktgruppen;
-			
+
 		} // public function hasProductgroupDiscount($product_id)
 
@@ -1124,8 +1124,8 @@
 		 */
 		public function getProductgroupDiscount($product_id)
-		{ 
-			
+		{
+
 			if (!$this->hasProductgroupDiscount($product_id)) return 0;
-			
+
 			$rabatt_produktgruppe = $this->db->fetchOne("
 				SELECT
@@ -1137,17 +1137,17 @@
 					P.`id` = '".wpsg_q($product_id)."'
 			");
-			
-			$discount = explode("_", $rabatt_produktgruppe); 
-			
+
+			$discount = explode("_", $rabatt_produktgruppe);
+
 			return $discount[3];
-			
+
 		} // public function getProductgroupDiscount($product_id)
-		
+
 		private function getOptionData()
 		{
-			
+
 			if (@is_array($this->shop->get_option("wpsg_mod_discount_data"))) $data_rabatt = $this->shop->get_option("wpsg_mod_discount_data");
 	 		else
-	 		{	 
+	 		{
 				$data_rabatt = @unserialize($this->shop->get_option("wpsg_mod_discount_data"));
 				if (!is_array($data_rabatt)) $data_rabatt = array();
@@ -1155,7 +1155,7 @@
 
 	 		usort($data_rabatt, array($this, "cmp"));
-			
+
 	 		return $data_rabatt;
-	 		
+
 		} // private function getOptionData()
 
@@ -1165,17 +1165,17 @@
 		private function getHierarchie()
 		{
-			
+
 			$hierarchie = explode(',', $this->shop->get_option('wpsg_mod_discount_hierarchie'));
 			if (!wpsg_isSizedArray($hierarchie)) $hierarchie = array();
-				
+
 			if (!in_array('general', $hierarchie)) $hierarchie[] = 'general';
 			if (!in_array('product', $hierarchie)) $hierarchie[] = 'product';
 			if (!in_array('productgroup', $hierarchie)) $hierarchie[] = 'productgroup';
 			if (!in_array('customer', $hierarchie)) $hierarchie[] = 'customer';
-			
+
 			return wpsg_trim(array_unique($hierarchie));
-			
+
 		} // private function getHierarchie()
-		
+
 		/**
 		 * Gibt den Namen fÃŒr einen Rabatttyp zurÃŒck
@@ -1183,19 +1183,19 @@
 		public function getNameFromType($discount_type)
 		{
-			
+
 			switch ($discount_type)
 			{
-				
+
 				case 'general': return __('Rabatt auf alle Produkte', 'wpsg'); break;
 				case 'product': return __('Produktrabatt', 'wpsg'); break;
 				case 'productgroup': return __('Produktgruppenrabatt', 'wpsg'); break;
 				case 'customer': return __('Kundengruppenrabatt', 'wpsg'); break;
-				
+
 				default: throw new \wpsg\Exception(__('Es konnte kein Name fÃŒr einen Rabatttyp zurÃŒckgegeben werden', 'wpsg'));
-				
-			}
-						
+
+			}
+
 		} // public function getNameFromType($discount_type)
-		
+
 	} // class wpsg_mod_discount
 
Index: /mods/wpsg_mod_productgroups.class.php
===================================================================
--- /mods/wpsg_mod_productgroups.class.php	(revision 6337)
+++ /mods/wpsg_mod_productgroups.class.php	(revision 6338)
@@ -5,11 +5,11 @@
 	 * @author daniel
 	 */
-	class wpsg_mod_productgroups extends wpsg_mod_basic 
+	class wpsg_mod_productgroups extends wpsg_mod_basic
 	{
-		
+
 		var $lizenz = 1;
 		var $id = 9;
 		var $hilfeURL = 'http://wpshopgermany.de/?p=868';
-		
+
 		/**
 		 * Costructor
@@ -17,21 +17,21 @@
 		public function __construct()
 		{
-			
+
 			parent::__construct();
-			
+
 			$this->name = __('Produktgruppen', 'wpsg');
 			$this->group = __('Produkte', 'wpsg');
 			$this->desc = __('ErmÃ¶glicht die Zuordnung von Produkten zu Produktgruppen.', 'wpsg');
-									
+
 		} // public function __construct()
-		 
+
 		public function install()
 		{
-			
+
 			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
-					
+
 			/**
 			 * Produktgruppentabelle anlegen
-			 */ 
+			 */
 			$sql = "CREATE TABLE ".WPSG_TBL_PRODUCTS_GROUP." (
 		   		id mediumint(9) NOT NULL AUTO_INCREMENT,
@@ -47,7 +47,7 @@
 		   		PRIMARY KEY  (id)
 		   	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
-   	   	 
+
    			dbDelta($sql);
-   			
+
    			/**
 		   	 * Tabelle fÃŒr die Sticky Produkte
@@ -60,108 +60,108 @@
 		   		PRIMARY KEY  (id)
 		   	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
-		   	
+
 		   	dbDelta($sql);
-			
+
 		} // public function install()
-		
+
 		public function init()
 		{
 
 			require_once(WPSG_PATH_MOD.'mod_productgroups/wpsg_productgroup.php');
-			
+
 			$role_object = get_role('administrator');
 			$role_object->add_cap('wpsg_productgroup');
-			
+
 		} // public function init()
-		
-		public function settings_edit() 
-		{
-			
+
+		public function settings_edit()
+		{
+
 			$pages = get_pages();
-			
+
 			$arPages = array(
 				'-1' => __('Nicht zugeordnet', 'wpsg')
 			);
-			
+
 			foreach ($pages as $k => $v)
 			{
 				$arPages[$v->ID] = $v->post_title.' (ID:'.$v->ID.')';
 			}
-			
-			$this->shop->view['pages'] = $arPages;			
-			
+
+			$this->shop->view['pages'] = $arPages;
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/settings_edit.phtml');
-			
+
 		} // public function settings_edit()
-		
-		public function settings_save() 
-		{
-			
+
+		public function settings_save()
+		{
+
 			$this->shop->update_option('wpsg_productgroups_page', $_REQUEST['wpsg_productgroups_page']);
 			$this->shop->update_option('wpsg_productgroups_order', $_REQUEST['wpsg_productgroups_order']);
-			
+
 		} // public function settings_save()
-		
-		public function admin_setcapabilities() { 
-			
+
+		public function admin_setcapabilities() {
+
 			$this->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/admin_setcapabilities.phtml');
-			
+
 		} // public function admin_setcapabilities()
-		
+
 		public function wpsg_add_pages()
 		{
-						
+
 			add_submenu_page('wpsg-Admin', __("Produktgruppen", "wpsg"), __("Produktgruppen", "wpsg"), 'wpsg_productgroup', 'wpsg-Productgroups', array($this, 'dispatch'));
-			
+
 		} // public function wpsg_add_pages()
-						
-		public function produkt_del($produkt_id) 
-		{ 
+
+		public function produkt_del($produkt_id)
+		{
 
 			$this->db->Query("DELETE FROM `".WPSG_TBL_PRODUCTS_STICKY."` WHERE `produkt_id` = '".wpsg_q($produkt_id)."'");
-			
+
 		} // public function produkt_del($produkt_id)
-		
+
 		public function shortcode($atts)
 		{
 
 			// [wpshopgermany produktgruppe="1" sortierung="id" richtung="asc"]
-			
+
 			$pg_id = $atts['produktgruppe'];
 			$pg_template = $this->db->fetchOne("SELECT `template_file` FROM `".WPSG_TBL_PRODUCTS_GROUP."` WHERE `id` = '".wpsg_q($pg_id)."'");
-			
+
 			$arSortierung = Array('id', 'name', 'anr', 'preis');
 			$arDirection = Array('asc', 'desc');
-			
+
 			$strOrder = 'sticky DESC, ';
-			
+
 			if (isset($atts['sortierung']) && in_array($atts['sortierung'], $arSortierung))
 			{
-					
+
 				$strOrder .= 'P.`'.wpsg_q($atts['sortierung']).'`';
-				
+
 				if (isset($atts['richtung']) && in_array($atts['richtung'], $arDirection))
 				{
-					
+
 					$strOrder .= ' '.wpsg_q($atts['richtung']);
-					
+
 				}
 				else
 				{
-					
+
 					$strOrder .= ' ASC';
-					
-				}
-								
+
+				}
+
 			}
 			else
 			{
-				
+
 				$strOrder .= 'P.`id` ASC';
-				
-			}
-			
+
+			}
+
 			$arProduktIDs = $this->db->fetchAssocField("
-				SELECT 
+				SELECT
 					P.`id`,
 					IF (
@@ -170,28 +170,28 @@
 						'0'
 					) AS sticky
-				FROM 
+				FROM
 					`".WPSG_TBL_PRODUCTS."` AS P
-				WHERE 
-					P.`pgruppe` = '".wpsg_q($pg_id)."' AND 
-					P.`deleted` != '1' AND 
+				WHERE
+					P.`pgruppe` = '".wpsg_q($pg_id)."' AND
+					P.`deleted` != '1' AND
 					P.`lang_parent` <= 0
 				ORDER BY
 					".$strOrder."
 			");
-						
+
 			if ($pg_template !== '0' && $pg_template !== '') $template = $pg_template; else $template = false;
-			
-			$strReturn = '';			
+
+			$strReturn = '';
 			foreach ((array)$arProduktIDs as $p_id)
 			{
-				
+
 				//if ($pg_template !== '0' && $pg_template !== '') $template = $pg_template; else $template = $this->db->fetchOne("SELECT `ptemplate_file` FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($p_id)."'");
-				
+
 				$strReturn .= $this->shop->renderProdukt($p_id, $template);
-				
-			}
-			
+
+			}
+
 			return $strReturn;
-			
+
 		} // public function shortcode($atts)
 
@@ -201,26 +201,26 @@
 		public function loadProduktArray(&$arrProdukt)
 		{
-			
+
 			$arrGrp = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS_GROUP."` WHERE `id` = '".wpsg_q($arrProdukt['pgruppe'])."'");
-			
+
 			if ($this->shop->isOtherLang())
 			{
-				
+
 				$lang = @unserialize($arrGrp['lang']);
-				
+
 				if (is_array($lang) && wpsg_isSizedString($lang[$this->shop->getCurrentLanguageCode()]['name'])) $arrGrp['name'] = $lang[$this->shop->getCurrentLanguageCode()]['name'];
-				
-			}
-			
+
+			}
+
 			$arrProdukt['pgruppe_name'] = $arrGrp['name'];
-			
+
 			// ?? Scheint zu funktionieren
-			$arrProdukt['rabatt'] = $arrGrp['rabatt'];	
-		
+			$arrProdukt['rabatt'] = $arrGrp['rabatt'];
+
 		}
-		
-		public function produkt_save(&$produkt_id) 
-		{
-				
+
+		public function produkt_save(&$produkt_id)
+		{
+
 			$sticky_id = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_PRODUCTS_STICKY."` WHERE `produkt_id` = '".wpsg_q($produkt_id)."'");
 
@@ -230,5 +230,5 @@
 				'bis' => wpsg_q(strtotime($_REQUEST['wpsg_productgroup_sticky_bis']))
 			);
-			
+
 			if ($sticky_id > 0)
 			{
@@ -239,38 +239,38 @@
 				$this->db->ImportQuery(WPSG_TBL_PRODUCTS_STICKY, $data);
 			}
-			
+
 			$data = array(
 				'pgruppe' => wpsg_q($_REQUEST['wpsg_productgroup'])
 			);
-			
+
 			$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, $data, "`id` = '".wpsg_q($produkt_id)."'");
-			
+
 		} // public function produkt_save($produkt_id)
-		
-		public function produkt_copy(&$produkt_id, &$copy_id) 
-		{ 
-			
+
+		public function produkt_copy(&$produkt_id, &$copy_id)
+		{
+
 			$arSticky = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_PRODUCTS_STICKY."` WHERE `produkt_id` = '".wpsg_q($produkt_id)."'");
-			
+
 			foreach ((array)$arSticky as $s)
 			{
-				
+
 				unset($s['id']);
 				$s['produkt_id'] = wpsg_q($copy_id);
-				
+
 				$this->db->ImportQuery(WPSG_TBL_PRODUCTS_STICKY, $s);
-				
-			}
-			
+
+			}
+
 		} // public function produkt_copy(&$produkt_id, &$copy_id)
-		
+
 		public function product_addedit_content(&$product_content, &$product_data)
 		{
-		
+
 			if (isset($_REQUEST['wpsg_lang'])) return;
-			
+
 			$this->shop->view['wpsg_mod_productgroups']['data'] = array();
-			$this->shop->view['wpsg_mod_productgroups']['data'][0] = __('Nicht zugewiesen.', 'wpsg'); 
-			
+			$this->shop->view['wpsg_mod_productgroups']['data'][0] = __('Nicht zugewiesen.', 'wpsg');
+
 			// Kein Array Merge ! Da indexe gelÃ¶scht werden
 			$groups_db = $this->db->fetchAssocField("
@@ -285,27 +285,27 @@
 			", "id", "name");
 			$this->shop->view['wpsg_mod_productgroups']['data'] = array_diff_key($this->shop->view['wpsg_mod_productgroups']['data'], $groups_db) + $groups_db;
-			
+
 			if (wpsg_isSizedInt($product_data['id']))
 			{
-					 
+
 				$this->shop->view['wpsg_mod_productgroups']['produkt_data'] = $product_data;
-								
+
 				$sticky_data = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS_STICKY."` WHERE `produkt_id` = '".wpsg_q($product_data['id'])."'");
-							
+
 				if ($sticky_data['von'] > 0) $this->shop->view['wpsg_mod_productgroups']['sticky_von'] = date('d.m.Y', $sticky_data['von']);
 				if ($sticky_data['bis'] > 0) $this->shop->view['wpsg_mod_productgroups']['sticky_bis'] = date('d.m.Y', $sticky_data['bis']);;
-						
-			}			
-			
+
+			}
+
 			$product_content['wpsg_mod_productgroups'] = array(
 				'title' => __('Produktgruppen', 'wpsg'),
 				'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/produkt_addedit_sidebar.phtml', false)
 			);
-		
+
 		} // public function produkt_edit_sidebar(&$product_content, &$produkt_data)
-		
-		public function content_filter(&$content) 
-		{
-			
+
+		public function content_filter(&$content)
+		{
+
 			if (get_the_id() <= 0 || get_the_id() != $this->shop->get_option('wpsg_productgroups_page')) return;
 
@@ -322,23 +322,23 @@
 						`deleted` = '0'
 					ORDER BY
-						`name`			
+						`name`
 				");
 
 				if ($this->shop->isOtherLang())
 				{
-					
+
 					$lang = @unserialize($arrGrp['lang']);
-					
-					if (is_array($lang) && wpsg_isSizedString($lang[$this->shop->getCurrentLanguageCode()]['name'])) $arrGrp['name'] = $lang[$this->shop->getCurrentLanguageCode()]['name']; 
-					
-				}
-	
+
+					if (is_array($lang) && wpsg_isSizedString($lang[$this->shop->getCurrentLanguageCode()]['name'])) $arrGrp['name'] = $lang[$this->shop->getCurrentLanguageCode()]['name'];
+
+				}
+
 				$strOrder = "sticky DESC";
 				if ($this->shop->get_option('wpsg_productgroups_order') != '')
 				{
-							
+
 					switch ($this->shop->get_option('wpsg_productgroups_order'))
 					{
-									
+
 						case 'id':
 							$strOrder .= ", P.`id` ASC ";
@@ -346,8 +346,8 @@
 						case 'alphabetisch':
 							$strOrder .= ", P.`name` ASC ";
-							break;		
+							break;
 						case 'buyed':
 							$strOrder .= ", `buyed` DESC ";
-							break;	
+							break;
 						case 'erstellungsdatum':
 							$strOrder .= ", `cdate` DESC ";
@@ -355,22 +355,22 @@
 						case 'preis':
 							$strOrder .= ", `preis` DESC ";
-							break;			
-									
+							break;
+
 					}
-								
-				}
-				 
+
+				}
+
 				if ($strOrder != "") $strOrder = " ORDER BY ".$strOrder;
-				
-				$arrProdukte = $this->shop->db->fetchAssoc("SELECT 
+
+				$arrProdukte = $this->shop->db->fetchAssoc("SELECT
 						P.`id`,
-						(IF('".time()."' > PS.`von` AND '".time()."' < PS.`bis`, 1, 0)) AS sticky, 
-						(SELECT SUM(`menge`) FROM `".WPSG_TBL_ORDERPRODUCT."` AS OP WHERE OP.`p_id` = P.`id`) AS buyed 
-					FROM 
+						(IF('".time()."' > PS.`von` AND '".time()."' < PS.`bis`, 1, 0)) AS sticky,
+						(SELECT SUM(`menge`) FROM `".WPSG_TBL_ORDERPRODUCT."` AS OP WHERE OP.`p_id` = P.`id`) AS buyed
+					FROM
 						`".WPSG_TBL_PRODUCTS."` AS P
 							LEFT JOIN `".WPSG_TBL_PRODUCTS_STICKY."` AS PS ON (P.`id` = PS.`produkt_id`)
-					WHERE 
-						P.`pgruppe` = '".wpsg_q($arrGrp['id'])."' AND 
-						P.`deleted` = '0' 
+					WHERE
+						P.`pgruppe` = '".wpsg_q($arrGrp['id'])."' AND
+						P.`deleted` = '0'
 					".$strOrder."
 				");
@@ -379,21 +379,21 @@
 				foreach ($arrProdukte as $k => $p)
 				{
-					
+
 					$arrProdukte[$k] = $this->shop->loadProduktArray($p['id']);
-					
+
 					$arrProdukte[$k]['bilder'] = $this->shop->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($p['id']));
 					if (!wpsg_isSizedArray($arrProdukte[$k]['bilder'])) $arrProdukte[$k]['bilder'] = array();
-					 							
+
 				}
 
 				$this->shop->view['data'] = $arrGrp;
 				$this->shop->view['data']['produkte'] = $arrProdukte;
-								
+
 				$content = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/show.phtml', false);
-				
-			}
-			else 
-			{
-				
+
+			}
+			else
+			{
+
 				$arrGrp = $this->db->fetchAssoc("
 					SELECT
@@ -404,27 +404,27 @@
 						`deleted` = '0'
 					ORDER BY
-						`name`			
+						`name`
 				");
-				
+
 				foreach ($arrGrp as $k => $pg)
 				{
-					
+
 					if ($this->shop->isOtherLang())
 					{
-						
+
 						$lang = @unserialize($pg['lang']);
-						
+
 						if (is_array($lang) && wpsg_isSizedString($lang[$this->shop->getCurrentLanguageCode()]['name'])) $pg['name'] = $lang[$this->shop->getCurrentLanguageCode()]['name'];
-						
+
 					}
-					
+
 					$strOrder = "sticky DESC";
-					
+
 					if ($this->shop->get_option('wpsg_productgroups_order') != '')
 					{
-								
+
 						switch ($this->shop->get_option('wpsg_productgroups_order'))
 						{
-									
+
 							case 'id':
 								$strOrder .= ", P.`id` ASC ";
@@ -432,8 +432,8 @@
 							case 'alphabetisch':
 								$strOrder .= ", P.`name` ASC ";
-								break;		
+								break;
 							case 'buyed':
 								$strOrder .= ", `buyed` DESC ";
-								break;	
+								break;
 							case 'erstellungsdatum':
 								$strOrder .= ", `cdate` DESC ";
@@ -441,62 +441,62 @@
 							case 'preis':
 								$strOrder .= ", `preis` DESC ";
-								break;			
-									
+								break;
+
 						}
-								
+
 					}
-					
+
 					if ($strOrder != "") $strOrder = " ORDER BY ".$strOrder;
-				  
-					$arrProdukte = $this->db->fetchAssoc("SELECT 
-															P.`id`, 
-															(IF('".time()."' > PS.`von` AND '".time()."' < PS.`bis`, 1, 0)) AS sticky, 
-															(SELECT SUM(`menge`) FROM `".WPSG_TBL_ORDERPRODUCT."` AS OP WHERE OP.`p_id` = P.`id`) AS buyed 
-														FROM 
-															`".WPSG_TBL_PRODUCTS."` AS P		
-																	LEFT JOIN `".WPSG_TBL_PRODUCTS_STICKY."` AS PS ON (P.`id` = PS.`produkt_id`)					
-														WHERE 
-															P.`pgruppe` = '".wpsg_q($pg['id'])."' AND 
-															P.`deleted` = '0' 
+
+					$arrProdukte = $this->db->fetchAssoc("SELECT
+															P.`id`,
+															(IF('".time()."' > PS.`von` AND '".time()."' < PS.`bis`, 1, 0)) AS sticky,
+															(SELECT SUM(`menge`) FROM `".WPSG_TBL_ORDERPRODUCT."` AS OP WHERE OP.`p_id` = P.`id`) AS buyed
+														FROM
+															`".WPSG_TBL_PRODUCTS."` AS P
+																	LEFT JOIN `".WPSG_TBL_PRODUCTS_STICKY."` AS PS ON (P.`id` = PS.`produkt_id`)
+														WHERE
+															P.`pgruppe` = '".wpsg_q($pg['id'])."' AND
+															P.`deleted` = '0'
 														".$strOrder."
 													");
-					
+
 					// Bilder der Produkte
 					foreach ($arrProdukte as $k2 => $p)
 					{
-						
+
 						$arrProdukte[$k2] = $this->shop->loadProduktArray($p['id']);
-						
+
 						$arrProdukte[$k2]['bilder'] = $this->shop->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($p['id']));
 						if (!wpsg_isSizedArray($arrProdukte[$k2]['bilder'])) $arrProdukte[$k2]['bilder'] = array();
-						 
+
 					}
 					$this->shop->view['data'][$pg['id']]['produkte'] = $arrProdukte;
 					$this->shop->view['data'][$pg['id']]['pgruppe_name'] = $pg['name'];
-					
-				}
-				
+
+				}
+
 				$content = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/list.phtml', false);
-				
-			}
-			
+
+			}
+
 			return -2;
-			
+
 		}
-		
-		public function wpsg_mod_export_loadFields(&$arFields) 
-		{ 
+
+		public function wpsg_mod_export_loadFields(&$arFields)
+		{
 
 			$arFields[20]['fields']['pgruppe_id'] = __('Produktgruppe ID', 'wpsg');
 			$arFields[20]['fields']['pgruppe_name'] = __('Produktgruppe Name', 'wpsg');
-			
+
 		} // public function wpsg_mod_export_loadFields(&$arFields)
-		
-		public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $productkey, $product_index, $profil_separator) 
-		{ 
- 
+
+		public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $productkey, $product_index, $profil_separator)
+		{
+
 			if (wpsg_isSizedInt($o_id) && !wpsg_isSizedInt($p_id))
 			{
-				
+
 				$product_db = $this->db->fetchRow("
 					SELECT
@@ -504,5 +504,5 @@
 						GROUP_CONCAT(PG.`name`) AS `pgruppe_name`
 					FROM
-						`".WPSG_TBL_ORDERPRODUCT."` AS OP 
+						`".WPSG_TBL_ORDERPRODUCT."` AS OP
 							LEFT JOIN `".WPSG_TBL_PRODUCTS."` AS P ON (OP.`p_id` = P.`id`)
 							LEFT JOIN `".WPSG_TBL_PRODUCTS_GROUP."` AS PG ON (PG.`id` = P.`pgruppe`)
@@ -512,12 +512,12 @@
 						P.`id`
 				");
-				 				
+
 			}
 			else if (wpsg_isSizedInt($p_id))
 			{
-				
+
 				$product_db = $this->shop->cache->loadProduct($p_id);
 				$product_db['pgruppe_name'] = $this->db->fetchOne("SELECT `name` FROM `".WPSG_TBL_PRODUCTS_GROUP."` WHERE `id` = '".wpsg_q($product_db['pgruppe'])."' ");
-				
+
 			}
 			else
@@ -525,17 +525,17 @@
 				return;
 			}
-			
+
 			switch ($field_value)
 			{
-				
+
 				case 'pgruppe_id': $return = $product_db['pgruppe']; break;
 				case 'pgruppe_name': $return = $product_db['pgruppe_name']; break;
-				
-			}
-			
+
+			}
+
 		} // public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $productkey, $product_index, $profil_separator)
-		
+
 		/* -- */
-		
+
 		/**
 		 * Gibt einen Array mit allen Produktgruppen zurÃŒck und beachtet die Ãbersetzung
@@ -543,5 +543,5 @@
 		public function getAllProductGroups()
 		{
-			
+
 			$arPG = $this->db->fetchAssocField("
 				SELECT
@@ -552,31 +552,31 @@
 					PG.`deleted` != '1'
 				ORDER BY
-					PG.`name` ASC	
+					PG.`name` ASC
 			", "id", "name");
-			
+
 			if ($this->shop->isOtherLang())
 			{
-				
+
 				foreach ($arPG as $k => $pg)
 				{
-					
+
 					$lang = @unserialize($pg['lang']);
-					
+
 					if (is_array($lang) && wpsg_isSizedString($lang[$this->shop->getCurrentLanguageCode()]['name'])) $arPG['name'] = $lang[$this->shop->getCurrentLanguageCode()]['name'];
-					
-				}
-				
-			}
-						
+
+				}
+
+			}
+
 			return $arPG;
-			
+
 		} // public function getAllProductGroups()
-		
+
 		public function dispatch()
 		{
-			 
+
 			if (isset($_REQUEST['wpsg_mod_action']) && $_REQUEST['wpsg_mod_action'] == "add")
 			{
-				$this->addAction();	
+				$this->addAction();
 			}
 			else if (isset($_REQUEST['wpsg_mod_action']) && $_REQUEST['wpsg_mod_action'] == "edit")
@@ -593,10 +593,10 @@
 			}
 			else
-			{	
-				$this->indexAction();				
-			}
-			
+			{
+				$this->indexAction();
+			}
+
 		} // public function dispatch()
-		
+
 		public function indexAction()
 		{
@@ -644,17 +644,17 @@
 
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/index.phtml');
-			
+
 		} // public function indexAction()
-		
+
 		public function delAction()
 		{
-			
+
 			$this->db->Query("DELETE FROM `".WPSG_TBL_PRODUCTS_GROUP."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 			$this->shop->addBackendMessage(__('Produktgruppe wurde erfolgreich gelÃ¶scht.', 'wpsg'));
-			
+
 			$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Productgroups&wpsg_mod_action=index');
-			
+
 		} // public function delAction()
-		
+
 		public function saveAction()
 		{
@@ -666,47 +666,47 @@
 				'stock_aktiv' => wpsg_q($_REQUEST['wpsg_mod_productgroups']['stock_aktiv']),
 				'stock_value' => wpsg_q($_REQUEST['wpsg_mod_productgroups']['stock_value']),
-				'lang' => wpsg_q(serialize($_REQUEST['lang']))			
+				'lang' => wpsg_q(serialize(wpsg_getArray($_REQUEST['lang'])))
 			);
-			
-			if ($_REQUEST['edit_id'] > 0)
-			{
-				
+
+			if (wpsg_getStr($_REQUEST['edit_id']) > 0)
+			{
+
 				$this->db->UpdateQuery(WPSG_TBL_PRODUCTS_GROUP, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 				$this->shop->addBackendMessage(__('Produktgruppe erfolgreich gespeichert.', 'wpsg'));
-				
+
 			}
 			else
 			{
-				
+
 				$data['cdate'] = "NOW()";
 				$_REQUEST['edit_id'] = $this->db->ImportQuery(WPSG_TBL_PRODUCTS_GROUP, $data);
 				$this->shop->addBackendMessage(__('Produktgruppe erfolgreich angelegt.', 'wpsg'));
-				
-			}
-						
+
+			}
+
 			$this->shop->callMods('wpsg_mod_productgroups_save', array($_REQUEST['edit_id']));
-			
+
 			if (isset($_REQUEST['submit_index'])) $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Productgroups&wpsg_mod_action=index');
 			else $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Productgroups&wpsg_mod_action=edit&edit_id='.$_REQUEST['edit_id']);
-			
+
 		} // public function saveAction()
-		
+
 		public function editAction()
 		{
-			
+
 			$this->shop->view['data'] = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS_GROUP."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 			$this->shop->view['data']['lang'] = @unserialize($this->shop->view['data']['lang']);
 			if (!is_array($this->shop->view['data']['lang'])) $this->shop->view['data']['lang'] = array();
 			$this->shop->view['languages'] = $this->shop->getStoreLanguages();
-			
+
 			$this->addeditAction();
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/add.phtml');
-			
+
 		} // public function editAction()
-		
+
 		public function addAction()
 		{
-			
+
 			$this->addeditAction();
 			$this->shop->view['data'] = array(
@@ -717,50 +717,50 @@
 
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/add.phtml');
-			
+
 		} // public function addAction()
-		
+
 		public function addeditAction()
 		{
-			
+
 			$this->shop->view['templates'] = array();
-			$this->shop->view['templates'][0] = __('Individuelle Produkttemplates', 'wpsg'); 
+			$this->shop->view['templates'][0] = __('Individuelle Produkttemplates', 'wpsg');
 			$this->shop->view['templates'] = wpsg_array_merge($this->shop->view['templates'], $this->shop->loadProduktTemplates(true));
-			
-			$pages = get_pages();			
+
+			$pages = get_pages();
 			$arPages = array(
 				'-1' => __('Nicht zugeordnet', 'wpsg')
-			);			
+			);
 			foreach ($pages as $k => $v)
 			{
 				$arPages[$v->ID] = $v->post_title.' (ID:'.$v->ID.')';
-			}			
-			$this->shop->view['pages'] = $arPages;	
-			
+			}
+			$this->shop->view['pages'] = $arPages;
+
 		} // public function addeditAction()
-		 		
+
 		public function checkPgroupsBestand($produkt, &$menge, &$menge_neu)
 		{
-			
+
 			if (preg_match('/(pv_)|(\|(.*))/', $produkt['id']))
 			{
 				$pID = preg_replace('/(pv_)|(\|(.*))/', '', $produkt['id']);
 			}
-			else 
+			else
 			{
 				$pID = $produkt['id'];
 			}
-			
+
 			$g_id = intval($this->db->fetchOne("SELECT `pgruppe` FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".$pID."'"));
-			
+
 			$pgroups_stock = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS_GROUP."` WHERE `id` = '".$g_id."'");
-			
+
 			if ($pgroups_stock['stock_aktiv'] != '1') { return; }
-			
+
 			if ($menge_neu >= intval($pgroups_stock['stock_value']))
 			{
-				
+
 				if ($this->shop->get_option('wpsg_mod_stock_allow') != '1')
 				{
-					$this->shop->addFrontendError(__('Menge ÃŒberschreitet Warenbestand!', 'wpsg'));	
+					$this->shop->addFrontendError(__('Menge ÃŒberschreitet Warenbestand!', 'wpsg'));
 				}
 				else
@@ -772,16 +772,16 @@
 			}
 		}
-				
-		public function wpsg_mod_productgroups_addedit_sidebar(&$productgroupdata) 
-		{
-			
+
+		public function wpsg_mod_productgroups_addedit_sidebar(&$productgroupdata)
+		{
+
 			$this->shop->view['wpsg_mod_productgroups']['data'] = $productgroupdata;
 
 			if (wpsg_isSizedInt($this->shop->view['wpsg_mod_productgroups']['data']['stock_aktiv'])) { $this->shop->view['wpsg_mod_productgroups']['data']['stock_aktiv'] = true; }
 
-			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/productgroups_addedit_sidebar.phtml');	
-			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productgroups/productgroups_addedit_sidebar.phtml');
+
 		} // public function wpsg_mod_productgroups_addedit_sidebar(&$productgroupdata)
-		
+
 	} // class wpsg_mod_productgroups extends wpsg_mod_basic
 
Index: /mods/wpsg_mod_produktartikel.class.php
===================================================================
--- /mods/wpsg_mod_produktartikel.class.php	(revision 6337)
+++ /mods/wpsg_mod_produktartikel.class.php	(revision 6338)
@@ -5,7 +5,7 @@
 	 * Modul der die Produkte als eigene Artikeltypen speichert
 	 */
-	class wpsg_mod_produktartikel extends wpsg_mod_basic 
+	class wpsg_mod_produktartikel extends wpsg_mod_basic
 	{
-		
+
 		var $lizenz = 1;
 		var $id = 15;
@@ -13,5 +13,5 @@
 		var $version = "9.9.9";
 		var $free = false;
-		
+
 		/**
 		 * Constructor
@@ -19,25 +19,25 @@
 		public function __construct()
 		{
-			
+
 			parent::__construct();
-			
+
 			$this->name = __('ProduktArtikel', 'wpsg');
 			$this->group = __('Produkte', 'wpsg');
 			$this->desc = __('Produkte sind ein eigener Wordpress Artikeltyp und erscheinen so als Artikel und in der Suche.', 'wpsg');
-									
+
 		} // public function __construct()
-		
+
 		public function init()
 		{
-			
-			add_action('init', array($this, 'create_wpsg_post_types'));			
-			 			
+
+			add_action('init', array($this, 'create_wpsg_post_types'));
+
 		} // public function init()
 
-		public function wpsg_enqueue_scripts() 
-		{ 
-					
+		public function wpsg_enqueue_scripts()
+		{
+
 			if (is_admin()) return;
-			
+
 			if (	(	$this->shop->get_option('wpsg_mod_produktartikel_facebook') == '1' ||
 						$this->shop->get_option('wpsg_mod_produktartikel_google') == '1' ||
@@ -50,12 +50,12 @@
 
 			}
-			
+
 		} // public function wpsg_enqueue_scripts()
-		 
-		public function install() 
-		{ 
-			
+
+		public function install()
+		{
+
 			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
-			
+
 			/**
 			 * Produkt Tabelle erweitern
@@ -65,15 +65,15 @@
 				gtin VARCHAR (255) NOT NULL
 		   	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
-			
+
 			dbDelta($sql);
-			
+
 			// Standard Path Key setzen
 			if ($this->shop->get_option('wpsg_mod_produktartikel_pathkey') === false || $this->shop->get_option('wpsg_mod_produktartikel_pathkey') == '')
 			{
-				
+
 				$this->shop->update_option('wpsg_mod_produktartikel_pathkey', 'produkte');
-				
-			}			
-			
+
+			}
+
 			$this->shop->checkDefault('wpsg_mod_produktartikel_showui', '0');
 			$this->shop->checkDefault('wpsg_mod_produktartikel_showHome', '0');
@@ -81,228 +81,228 @@
 			$this->shop->checkDefault('wpsg_mod_produktartikel_showFeed', '0');
 			$this->shop->checkDefault('wpsg_mod_produktartikel_showSearch', '0');
-						
+
 			/*
 			 * Posts Tabelle erweitern
-			 */ 
+			 */
 			$sql = "CREATE TABLE ".$this->shop->prefix."posts (
 		   		wpsg_produkt_id INT(11) NOT NULL,
 		   		KEY wpsg_produkt_id (`wpsg_produkt_id`)
 		   	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
-   	   	 
+
    			dbDelta($sql);
-   			
-		} 
-		
-		public function be_ajax() 
-		{ 
-			 
+
+		}
+
+		public function be_ajax()
+		{
+
 			if (wpsg_isSizedString($_REQUEST['do'], 'setWPMLPathKey'))
 			{
-				
+
 				$icl_sitepress_settings = $this->shop->get_option('icl_sitepress_settings');
-				
+
 				$icl_sitepress_settings['custom_posts_sync_option'][$this->shop->get_option('wpsg_mod_produktartikel_pathkey')] = '1';
 				$this->shop->update_option('icl_sitepress_settings', $icl_sitepress_settings);
-				
-				$this->shop->addBackendMessage(__('Der Custom Post Type fÃŒr die Produkte kann nun ÃŒbersetzt werden.', 'wpsg'));				
+
+				$this->shop->addBackendMessage(__('Der Custom Post Type fÃŒr die Produkte kann nun ÃŒbersetzt werden.', 'wpsg'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemcheck');
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['do'], 'index_rebuild'))
 			{
-				
+
 				$arProductIDs = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_PRODUCTS."` ", "id");
-				
+
 				if (wpsg_isSizedArray($arProductIDs))
 				{
-				
+
 					// Ich lÃ¶sche alle Posts zu denen es die Produkte nicht mehr gibt
 					$this->db->Query("
-						DELETE FROM 
-							`".$this->shop->prefix."posts` 
-						WHERE  
+						DELETE FROM
+							`".$this->shop->prefix."posts`
+						WHERE
 							`wpsg_produkt_id` NOT IN (".wpsg_q(implode(',', $arProductIDs)).") AND
 							`wpsg_produkt_id` > 0
 					");
-					
+
 					$this->shop->update_option('wpsg_mod_produktartikel_rebuild', array(
 						'max' => sizeof($arProductIDs),
 						'product_ids' => $arProductIDs
 					));
-					 					
-					$this->shop->addBackendMessage(__('Zuordnungen werden neu aufgebaut. Bitte schlieÃen Sie die Seite nicht bis der Vorgang abgeschlossen ist.', 'wpsg'));				
-									
+
+					$this->shop->addBackendMessage(__('Zuordnungen werden neu aufgebaut. Bitte schlieÃen Sie die Seite nicht bis der Vorgang abgeschlossen ist.', 'wpsg'));
+
 				}
 				else
 				{
-									
+
 					$this->shop->update_option('wpsg_mod_produktartikel_rebuild', null);
-					
+
 					$this->shop->addBackendMessage(__('Ein Aufbau der Zuordnung nicht nicht notwendig.', 'wpsg'));
-					
-				}
-				
+
+				}
+
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktartikel');
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['do'], 'rebuild'))
 			{
-				
-				$arToDo = $this->shop->get_option('wpsg_mod_produktartikel_rebuild');				
+
+				$arToDo = $this->shop->get_option('wpsg_mod_produktartikel_rebuild');
 				$arProductIDs = $arToDo['product_ids'];
-				
+
 				$i = 0;
-				$limit = 20; 
-				 
+				$limit = 20;
+
 				foreach ($arProductIDs as $k => $product_id)
 				{
-					
+
 					$product_data = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($product_id)."' ");
 					$post_data = $this->db->fetchRow("SELECT * FROM `".$this->shop->prefix."posts` WHERE `wpsg_produkt_id` = '".wpsg_q($product_id)."' ");
-					
+
 					$_REQUEST['wpsg_mod_produktartikel']['path'] = wpsg_getStr($post_data['post_name'], '');
 					$_REQUEST['wpsg_mod_produktartikel']['kommentare'] = wpsg_getStr($post_data['comment_status'], '');
 					$_REQUEST['wpsg_produktartikel_menuorder'] = wpsg_getStr($post_data['menu_order'], '');
-					
+
 					if (wpsg_isSizedInt($product_data['lang_parent']))
 					{
-						
+
 						$_REQUEST['wpsg_lang'] = $product_data['lang_code'];
-						
+
 						$this->produkt_save_translation($product_data['lang_parent'], $product_data['id']);
-						
+
 					}
 					else
 					{
-					
+
 						$this->produkt_save($product_data['id']);
-						
+
 					}
-					
+
 					unset($arProductIDs[$k]);
-					
+
 					$i ++;
-					
+
 					if ($i >= $limit) break;
-					
-				}
-				
+
+				}
+
 				if (wpsg_isSizedArray($arProductIDs))
 				{
-					
+
 					$arToDo['product_ids'] = $arProductIDs;
 					$this->shop->update_option('wpsg_mod_produktartikel_rebuild', $arToDo);
-					$done = 1 - (sizeof($arProductIDs) / $arToDo['max']); 
-						
+					$done = 1 - (sizeof($arProductIDs) / $arToDo['max']);
+
 				}
 				else
 				{
-					
+
 					$this->shop->update_option('wpsg_mod_produktartikel_rebuild', null);
 					$done = 1;
-					
-				}
-				
+
+				}
+
 				wpsg_header::JSONData(array(
 					'done' => $done
 				));
-				
-			}
-			
+
+			}
+
 		}
-		
-		public function the_excerpt(&$content) 
-		{ 
-			
+
+		public function the_excerpt(&$content)
+		{
+
 			global $post;
 
 			if (get_post_type($post) == $this->shop->get_option('wpsg_mod_produktartikel_pathkey'))
 			{
-				
+
 				$produkt_id = $post->wpsg_produkt_id;
 				$content = $this->shop->renderProdukt($produkt_id);
-				
-			}
-			
+
+			}
+
 		} // public function the_excerpt(&$content)
-		
+
 		public function content_filter(&$content)
 		{
-						
+
 			global $post;
-						
+
 			// Artikel ist ein Produkt, hier das Rendern des Templates ÃŒbernehmen
 			if (get_post_type($post) == $this->shop->get_option('wpsg_mod_produktartikel_pathkey'))
 			{
-				 
-				$produkt_id = $post->wpsg_produkt_id;  
+
+				$produkt_id = $post->wpsg_produkt_id;
 				$content = $this->shop->renderProdukt($produkt_id);
-				
+
 				return -2;
-				
-			}
-						
+
+			}
+
 		} // public function content_filter()
-		 
-		public function pre_get_posts(&$query) 
-		{
- 
+
+		public function pre_get_posts(&$query)
+		{
+
 			if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_produktartikel_onlyMainQuery')) && !$query->is_main_query()) return;
-			
+
 			if ($this->shop->get_option('wpsg_mod_produktartikel_showHome') == '1' && is_home())
 			{
 
 				$this->setPostType($query);
-				 
-			}
-			
+
+			}
+
 			if ($this->shop->get_option('wpsg_mod_produktartikel_showCategory') == '1' && is_category())
 			{
-												
+
 				$this->setPostType($query);
-				 
-			}
-			
-			if ($this->shop->get_option('wpsg_mod_produktartikel_showFeed') == '1' && is_feed()) 
-			{
-				
+
+			}
+
+			if ($this->shop->get_option('wpsg_mod_produktartikel_showFeed') == '1' && is_feed())
+			{
+
 				$this->setPostType($query);
-				 
-			}
-			
+
+			}
+
 			if ($this->shop->get_option('wpsg_mod_produktartikel_showSearch') == '1' && is_search())
 			{
-				
+
 				$this->setPostType($query);
-				 
-			} 
-			
+
+			}
+
 			if (is_single() && $query->is_main_query())
 			{
-				
+
 				$this->setPostType($query);
-				
-			}
-			
+
+			}
+
 		} // public function pre_get_posts(&$query)
-		
+
 		public function settings_edit()
 		{
-			
+
 			// Rebuild
 			$this->shop->view['ToRebuild'] = $this->shop->get_option('wpsg_mod_produktartikel_rebuild');
-			
+
 			// VerfÃŒgbare Produkttemplates
 			$this->shop->view['arTemplates'] = $this->shop->loadProduktTemplates(true);
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_produktartikel/settings_edit.phtml');
-			
+
 		}
 
-		public function settings_save() 
-		{
-			
+		public function settings_save()
+		{
+
 			global $wpdb;
-			
+
 			$this->shop->update_option('wpsg_mod_produktartikel_showHome', $_REQUEST['wpsg_mod_produktartikel_showHome']);
 			$this->shop->update_option('wpsg_mod_produktartikel_showCategory', $_REQUEST['wpsg_mod_produktartikel_showCategory']);
@@ -310,12 +310,12 @@
 			$this->shop->update_option('wpsg_mod_produktartikel_showSearch', $_REQUEST['wpsg_mod_produktartikel_showSearch']);
 			$this->shop->update_option('wpsg_mod_produktartikel_onlyMainQuery', $_REQUEST['wpsg_mod_produktartikel_onlyMainQuery']);
-						
+
 			$this->shop->update_option('wpsg_mod_produktartikel_hometemplate', $_REQUEST['wpsg_mod_produktartikel_hometemplate']);
 			$this->shop->update_option('wpsg_mod_produktartikel_listtemplate', $_REQUEST['wpsg_mod_produktartikel_listtemplate']);
-			$this->shop->update_option('wpsg_mod_produktartikel_searchtemplate', $_REQUEST['wpsg_mod_produktartikel_searchtemplate']);			
+			$this->shop->update_option('wpsg_mod_produktartikel_searchtemplate', $_REQUEST['wpsg_mod_produktartikel_searchtemplate']);
 			$this->shop->update_option('wpsg_mod_produktartikel_facebook', $_REQUEST['wpsg_mod_produktartikel_facebook']);
 			$this->shop->update_option('wpsg_mod_produktartikel_google', $_REQUEST['wpsg_mod_produktartikel_google']);
 			$this->shop->update_option('wpsg_mod_produktartikel_twitter', $_REQUEST['wpsg_mod_produktartikel_twitter']);
-			
+
 			$this->shop->update_option('wpsg_mod_produktartikel_showui', $_REQUEST['wpsg_mod_produktartikel_showui']);
 
@@ -323,46 +323,46 @@
 				$this->shop->update_option('wpsg_mod_produktartikel_postthumbnail', $_REQUEST['wpsg_mod_produktartikel_postthumbnail']);
 			}
-			
+
 			$pathkey_alt = $this->shop->get_option('wpsg_mod_produktartikel_pathkey');
 			$pathkey_new = $this->shop->clear($_REQUEST['wpsg_mod_produktartikel_pathkey']);
-			
+
 			if ($pathkey_alt != $_REQUEST['wpsg_mod_produktartikel_pathkey'] && $pathkey_new != '')
 			{
-				
+
 				$this->db->UpdateQuery($this->shop->prefix."posts", array(
 					'post_type' => wpsg_q($pathkey_new)
 				), "`post_type` = '".wpsg_q($pathkey_alt)."'");
-				
+
 				$this->shop->update_option('wpsg_mod_produktartikel_pathkey', $pathkey_new);
-				
+
 				$this->shop->addBackendMessage(__('Path Key erfolgreich geÃ€ndert. Die Produkt URLs haben sich geÃ€ndert!', 'wpsg'));
-				
+
 			}
 			else if (trim($_REQUEST['wpsg_mod_produktartikel_pathkey']) == '')
 			{
-				
+
 				$this->shop->addBackendError(__('Der Path Key darf nicht leer sein!', 'wpsg'));
-				
-			}
-			
+
+			}
+
 			$this->create_wpsg_post_types();
 			flush_rewrite_rules();
-			
+
 		} // public function settings_save()
-		
+
 		public function wpsg_add_pages()
 		{
 
 			$callback = add_submenu_page('wpsg-Admin', __("Produktkategorien", "wpsg"), __("Produktkategorien", "wpsg"), 'wpsg_produkt', 'wpsg-Productcategories', 'callback');
-			
+
 			add_action("load-".$callback, function() { header('Location: '.admin_url('edit-tags.php?taxonomy=wpsgtax')); exit; } );
 
 			add_filter('parent_file', array($this, 'setParentmenu'), 10, 1);
 			add_filter('submenu_file', array($this, 'setSubmenu'), 10, 1);
-				
+
 		} // public function wpsg_add_pages()
-		
+
 		function setParentmenu($parent_file) {
-		
+
 			//http://shop4.home/wp-admin/admin.php?page=wpsg-Admin
 			$parent_file = 'wp-admin/admin.php?page=wpsg-Admin';
@@ -371,7 +371,7 @@
 			return $parent_file;
 		}
-		
+
 		function setSubmenu($submenu_file) {
-		
+
 			//$submenu_file = 'wp-admin/admin.php?page=wpsg-Productcategories';
 			//edit-tags.php?taxonomy=wpsgtax
@@ -381,44 +381,44 @@
 			return $submenu_file;
 		}
-		
-		public function admin_includes() 
-		{ 
+
+		public function admin_includes()
+		{
 
 			echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_noJS', __('Socialshareprivacy nicht einbinden (Produktartikel)', 'wpsg'), $this->shop->get_option('wpsg_mod_produktartikel_noJS'), array(
 				'hint' => wpsg_translate('nohspc_'.__('Ist diese Option aktiv, so wird die benÃ¶tigte JavaScript Bibliothek <u>nicht</u> eingebunden, auch wenn die Optionen im <a href="#1#">Produktartikelmodul</a> aktiv sind.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktartikel')
 			));
-			
+
 		} // function admin_includes()
-		
-		public function admin_includes_save() 
-		{ 
-			
+
+		public function admin_includes_save()
+		{
+
 			$this->shop->update_option('wpsg_mod_produktartikel_noJS', $_REQUEST['wpsg_mod_produktartikel_noJS']);
-			
+
 		} // function admin_includes_save()
-		 
+
 		public function produkt_copy(&$produkt_id, &$copy_id)
-		{ 
-			
+		{
+
 			global $current_user;
-			
+
 			$product_source = $this->shop->cache->loadProduct($produkt_id);
 			$product_target = $this->shop->cache->loadProduct($copy_id);
-			
+
 			$post_content = $this->shop->renderProdukt($copy_id);
 			$post_content = $this->clear_post_content($post_content);
-			
+
 			$post_data = $this->db->fetchRow("
-				SELECT 
+				SELECT
 					`id`, `comment_status`, `menu_order`
-				FROM 
-					`".$this->shop->prefix."posts` 
-				WHERE 
+				FROM
+					`".$this->shop->prefix."posts`
+				WHERE
 					`wpsg_produkt_id` = '".wpsg_q($produkt_id)."' AND
 					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
 			");
-						
+
 			$data = array(
-				"post_title" => wpsg_q($product_target['name']), 
+				"post_title" => wpsg_q($product_target['name']),
 				'post_author' => $current_user->ID,
 				'post_content' => wpsg_q($post_content),
@@ -432,17 +432,17 @@
 				'post_date' => 'NOW()'
 			);
-			 
+
 			$post_id = $this->db->ImportQuery($this->shop->prefix.'posts', $data);
-			
+
 			$this->updatePostThumbnail($copy_id);
-			
+
 			// Taxonomie mit kopieren
 			$this->db->Query("DELETE FROM `".$this->shop->prefix."term_relationships` WHERE `object_id` = '".wpsg_q($post_id)."'");
-			
+
 			$arTaxOriginalProduct = $this->db->fetchAssocField("SELECT `term_taxonomy_id` FROM `".$this->shop->prefix."term_relationships` WHERE `object_id` = '".wpsg_q($post_data['id'])."' ");
-			
+
 			foreach ($arTaxOriginalProduct as $term_taxonomy_id)
 			{
-				
+
 				$this->db->ImportQuery($this->shop->prefix.'term_relationships', array(
 					'object_id' => wpsg_q($post_id),
@@ -450,61 +450,61 @@
 					'term_order' => '0'
 				));
-				
+
 				$count = $this->db->fetchOne("SELECT COUNT(*) FROM `".$this->shop->prefix."term_relationships` WHERE `term_taxonomy_id` = '".wpsg_q($term_taxonomy_id)."'");
-				
+
 				$this->db->UpdateQuery($this->shop->prefix."term_taxonomy", array(
 					'count' => wpsg_q($count)
 				), "`term_taxonomy_id` = '".wpsg_q($term_taxonomy_id)."'");
-				
-			}
-			 			
+
+			}
+
 		} // public function produkt_copy(&$produkt_id, &$copy_id)
-		 
-		public function produkt_del($produkt_id) 
-		{ 
-			
+
+		public function produkt_del($produkt_id)
+		{
+
 			global $wpdb;
-			
+
 			$post_id = $this->db->fetchOne("
-				SELECT 
-					`id` 
-				FROM 
-					`".$this->shop->prefix."posts` 
-				WHERE 
+				SELECT
+					`id`
+				FROM
+					`".$this->shop->prefix."posts`
+				WHERE
 					`wpsg_produkt_id` = '".wpsg_q($produkt_id)."' AND
 					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
 			");
-			
+
 			$this->db->Query("DELETE FROM `".$this->shop->prefix."posts` WHERE `wpsg_produkt_id` = '".wpsg_q($produkt_id)."'");
-			
+
 			$this->db->Query("DELETE FROM `".$this->shop->prefix."term_relationships` WHERE `object_id` = '".wpsg_q($post_id)."'");
-			
+
 			$this->db->Query("DELETE FROM `".$this->shop->prefix."postmeta` WHERE `post_id` = '".wpsg_q($post_id)."'");
-			
+
 			$this->updateTaxonomieCount();
-			
+
 		} // public function produkt_del($produkt_id)
-		
-		public function wp_head() 
-		{ 
-			
+
+		public function wp_head()
+		{
+
 			global $post;
-			
+
 			if (is_single($post) && get_post_type($post) == $this->shop->get_option('wpsg_mod_produktartikel_pathkey'))
 			{
-								
+
 				$produkt_id = $post->wpsg_produkt_id;
-				
+
 				$this->shop->view['data'] = $this->shop->loadProduktArray($produkt_id);
 				$this->shop->view['data']['url'] = '';
 				$this->getProduktlink($produkt_id, $this->shop->view['data']['url']);
-				
-				$this->shop->view['data']['beschreibung'] = preg_replace("/\r|\n/", "", wpsg_hspc(strip_tags($this->shop->view['data']['beschreibung'])));				
-				
+
+				$this->shop->view['data']['beschreibung'] = preg_replace("/\r|\n/", "", wpsg_hspc(strip_tags($this->shop->view['data']['beschreibung'])));
+
 				if ($this->shop->hasMod('wpsg_mod_produktbilder'))
 				{
 
 					$arBilder = array();
-					$arTemp = $this->shop->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($produkt_id)); 
+					$arTemp = $this->shop->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($produkt_id));
 
 					foreach($arTemp as $k => $v) {
@@ -512,7 +512,7 @@
 					}
 					if (isset($arBilder) && (sizeof($arBilder) > 0)) $this->shop->view['data']['bilder'] = $arBilder;
-					
-				}
-				
+
+				}
+
 				if ($this->shop->get_option('wpsg_mod_produktartikel_facebook') == '1')
 				{
@@ -522,29 +522,29 @@
 				{
 					$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_produktartikel/header_google.phtml');
-				} 		
-				
-			}
-						
+				}
+
+			}
+
 		} // public function wp_head()
-		
-		public function produkt_edit_allgemein(&$produkt_data) 
-		{ 
-		
+
+		public function produkt_edit_allgemein(&$produkt_data)
+		{
+
 			$this->shop->view['data'] = $produkt_data;
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_produktartikel/produkt_edit_allgemein.phtml');
-			
+
 		} // public function produkt_edit_allgemein(&$produkt_data)
-		
-		public function product_addedit_content(&$product_content, &$product_data) 
-		{ 
-			
+
+		public function product_addedit_content(&$product_content, &$product_data)
+		{
+
 			global $wpdb;
-						
+
 			// Bei Ãbersetzungen nichts machen
 			if (isset($_REQUEST['wpsg_lang'])) return;
-			
+
 			if (wpsg_isSizedInt($product_data['id']))
 			{
-				
+
 				$product_data = wpsg_array_merge($product_data, (array)$this->db->fetchRow("
 					SELECT
@@ -553,5 +553,5 @@
 						`menu_order`,
 						`post_name`
-					FROM	
+					FROM
 						`".$this->shop->prefix."posts`
 					WHERE
@@ -559,36 +559,36 @@
 						`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
 				"));
-				
-			}
-			
+
+			}
+
 			$product_content['wpsg_mod_produktartikel'] = array(
 				'title' => __('Kategorie / Artikel', 'wpsg'),
 				'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_produktartikel/produkt_addedit_content.phtml', false)
 			);
-			
+
 		} // public function product_addedit_content(&$product_content, &$product_data)
-		
+
 		public function produkt_save_translation(&$product_id, &$trans_id)
 		{
-					
+
 			if (function_exists('icl_object_id')) //if (is_plugin_active('sitepress-multilingual-cms/sitepress.php'))
 			{
-				
+
 				// WPML
 				$post_id = $this->getPostIdFromProductId($product_id);
-				
+
 				if (wpsg_isSizedInt($post_id))
 				{
-					
+
 					$trans_product = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($trans_id)."' ");
 					$post = $this->db->fetchRow("SELECT * FROM `".$this->shop->prefix."posts` WHERE `ID` = '".$post_id."' ");
-					
+
 					$trans_post_id = $this->getPostIdFromProductId($trans_id, $trans_product['name'], (($post['comment_status'] === 'open')?'1':'0'), $post['menu_order'], true);
-					
+
 					// Gibt es zu dem Post schon eine trid?
 					$trid = $this->db->fetchOne("SELECT `trid` FROM `".$this->shop->prefix."icl_translations` WHERE `element_type` = '".wpsg_q('post_'.$this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."' AND `element_id` = '".wpsg_q($post_id)."' ");
 					if (!wpsg_isSizedInt($trid))
 					{
-						
+
 						$trid = 1 + $this->db->fetchOne("SELECT MAX(`trid`) FROM ".$this->shop->prefix."icl_translations");
 						$this->db->ImportQuery($this->shop->prefix."icl_translations", array(
@@ -599,12 +599,12 @@
 							'source_language_code' => 'NULL'
 						));
-						
+
 					}
-					
+
 					// Gibt es schon einen ICL Eintrag zur Ãbersetzung?
 					$icl_id = $this->db->fetchOne("SELECT `translation_id` FROM `".$this->shop->prefix."icl_translations` WHERE `element_type` = '".wpsg_q('post_'.$this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."' AND `element_id` = '".wpsg_q($trans_post_id)."' ");
 					if (!wpsg_isSizedInt($icl_id))
 					{
-						
+
 						$this->db->ImportQuery($this->shop->prefix."icl_translations", array(
 							'element_type' => wpsg_q('post_'.$this->shop->get_option('wpsg_mod_produktartikel_pathkey')),
@@ -614,43 +614,43 @@
 							'source_language_code' => wpsg_q($this->shop->getDefaultLanguageCode())
 						));
-						
-					}					
-					
+
+					}
+
 				} else throw new \Exception(wpsg_translate(__('Custom Post Type existiert zu Produkt (ID:#1#) noch nicht.', 'wpsg'), $product_id));
-				 
+
 			}
 			else
 			{
-			
+
 				// qTranslate
 				// Da sich die Ãbersetzung geÃ€ndert hat muss das Produkt erneut gespeichert werden
 				$this->produkt_save($product_id);
-				
-			}
-			 
+
+			}
+
 		} // public function produkt_save_translation(&$produkt_id, &$trans_id)
-		
+
 		public function produkt_save_before(&$produkt_data)
 		{
-		
+
 			$produkt_data['ean'] = wpsg_tf(wpsg_getStr($_REQUEST['wpsg_mod_produktartikel']['ean']));
 			$produkt_data['gtin'] = wpsg_tf(wpsg_getStr($_REQUEST['wpsg_mod_produktartikel']['gtin']));
-		
+
 		} // public function produkt_save_before(&$produkt_data)
-		
-		public function produkt_save(&$product_id) 
-		{ 
- 
+
+		public function produkt_save(&$product_id)
+		{
+
 			$this->getPostIdFromProductId($product_id, $_REQUEST['wpsg_mod_produktartikel']['path'], $_REQUEST['wpsg_mod_produktartikel']['kommentare'], $_REQUEST['wpsg_produktartikel_menuorder'], true);
-			
+
 		} // public function produkt_save($produkt_id)
-		
+
 		public function create_wpsg_post_types()
 		{
-		 
+
 			$show_ui = false;
-			
+
 			if ($this->shop->get_option('wpsg_mod_produktartikel_showui') == '1') $show_ui = true;
-					
+
 			register_taxonomy('wpsgtax', $this->shop->get_option('wpsg_mod_produktartikel_pathkey'), array(
 				'label' => __('Produktkategorien', 'wpsg'),
@@ -664,5 +664,5 @@
 				'hierarchical' => true
 			));
-			
+
 			register_post_type($this->shop->get_option('wpsg_mod_produktartikel_pathkey'),
 				array(
@@ -680,19 +680,19 @@
 					'supports' => array('title', 'editor', 'thumbnail')
 				)
-			); 
-						
+			);
+
 		} // public function create_wpsg_post_types()
 
-		public function getProduktlink($product_id, &$url) 
+		public function getProduktlink($product_id, &$url)
 		{
 
 			$produkt_id = $this->shop->getProduktId($product_id);
-			
+
 			$post_id = $this->db->fetchOne("
-				SELECT 
-					`id` 
-				FROM 
-					`".$this->shop->prefix."posts` 
-				WHERE 
+				SELECT
+					`id`
+				FROM
+					`".$this->shop->prefix."posts`
+				WHERE
 					`wpsg_produkt_id` = '".wpsg_q($produkt_id)."' AND
 					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
@@ -701,59 +701,59 @@
 			// Wenn kein Post gefunden abbrechen, sonst gibt es die URL der Startseite und die alternative URL Bildung ÃŒber den Warenkorb funktioniert nicht.
 			if ($post_id <= 0) return;
-			
+
 			$url = get_permalink($post_id);
-			
+
 			if (function_exists('qtrans_convertURL'))
 			{
-				
+
 				$url = qtrans_convertURL($url);
-				
-			}
-			
-			return -1; 
-			
+
+			}
+
+			return -1;
+
 		} // public function getProduktlink($produkt_id)
-		
-		public function renderProdukt_templateSelect(&$produkt_data, &$template_file) 
-		{ 
-			 
+
+		public function renderProdukt_templateSelect(&$produkt_data, &$template_file)
+		{
+
 			if (($GLOBALS['wp_the_query']->is_category || $GLOBALS['wp_the_query']->is_post_type_archive($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))) && $this->shop->get_option('wpsg_mod_produktartikel_listtemplate') != '-1' && $this->shop->get_option('wpsg_mod_produktartikel_listtemplate') != false)
 			{
-				
-				$template_file = WPSG_PATH_PRODUKTTEMPLATES.$this->shop->get_option('wpsg_mod_produktartikel_listtemplate'); 
-				
+
+				$template_file = WPSG_PATH_PRODUKTTEMPLATES.$this->shop->get_option('wpsg_mod_produktartikel_listtemplate');
+
 			}
 			else if ($GLOBALS['wp_the_query']->is_search && $this->shop->get_option('wpsg_mod_produktartikel_searchtemplate') != '-1' && $this->shop->get_option('wpsg_mod_produktartikel_searchtemplate') != false)
 			{
-				
-				$template_file = WPSG_PATH_PRODUKTTEMPLATES.$this->shop->get_option('wpsg_mod_produktartikel_searchtemplate'); 
-				
-			} 
+
+				$template_file = WPSG_PATH_PRODUKTTEMPLATES.$this->shop->get_option('wpsg_mod_produktartikel_searchtemplate');
+
+			}
 			else if ($GLOBALS['wp_the_query']->is_home && $this->shop->get_option('wpsg_mod_produktartikel_hometemplate') != '-1' && $this->shop->get_option('wpsg_mod_produktartikel_hometemplate') != false)
 			{
-				
+
 				$template_file = WPSG_PATH_PRODUKTTEMPLATES.$this->shop->get_option('wpsg_mod_produktartikel_hometemplate');
-				
-			}
-			 
+
+			}
+
 		} // public function renderProdukt_templateSelect(&$produkt_data, &$template_file)
-		
-		public function loadProduktArray(&$produkt_data) 
-		{ 
+
+		public function loadProduktArray(&$produkt_data)
+		{
 
 			global $wpdb;
 
 			$product_id = $this->shop->getProduktId($produkt_data['id']);
-			
+
 			$post_id = $this->db->fetchOne("
-				SELECT 
-					`id` 
-				FROM 
-					`".$this->shop->prefix."posts` 
-				WHERE 
+				SELECT
+					`id`
+				FROM
+					`".$this->shop->prefix."posts`
+				WHERE
 					`wpsg_produkt_id` = '".wpsg_q($product_id)."' AND
 					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
 			");
-			
+
 			$post_data = $this->db->fetchRow("
 				SELECT
@@ -765,9 +765,9 @@
 					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
 			");
- 
+
 			$post_id = $post_data['id'];
-			
+
 			$arCat = $this->db->fetchOne("
-				SELECT 
+				SELECT
 					GROUP_CONCAT(DISTINCT `term_taxonomy_id`)
 				FROM
@@ -776,7 +776,7 @@
 					`object_id` = '".wpsg_q($post_id)."'
 			");
-			
+
 			$permalink = get_permalink($post_id);
-			
+
 			if (wpsg_isSizedInt($post_id) && wpsg_isSizedString($permalink))
 			{
@@ -784,24 +784,24 @@
 				$produkt_data = wpsg_array_merge($produkt_data, array(
 					'post_id' => $post_id,
-					'pos' => $post_data['menu_order'], 
+					'pos' => $post_data['menu_order'],
 					'url' => get_permalink($post_id),
-					'arCat' => $arCat	
+					'arCat' => $arCat
 				));
-				
-			}
-			
+
+			}
+
 		} // public function loadProduktArray(&$produkt_data)
-		
-		public function systemcheck(&$arData) 
-		{ 
-		
+
+		public function systemcheck(&$arData)
+		{
+
 			if (function_exists('icl_object_id'))
 			{
-				
+
 				$icl_sitepress_settings = $this->shop->get_option('icl_sitepress_settings');
-				
+
 				if (wpsg_getStr($icl_sitepress_settings['custom_posts_sync_option'][$this->shop->get_option('wpsg_mod_produktartikel_pathkey')]) !== '1')
 				{
-					
+
 					$arData[] = array(
 						'wpsg_mod_produktartikel_wpml_custom_post_type',
@@ -812,31 +812,31 @@
 						)
 					);
-					
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 		} // public function systemcheck($arData)
-		
+
 		/* Modulfunktionen */
-		
+
 		private function updateTaxonomieCount()
 		{
-			
+
 			$arTermTaxonomyID = $this->db->fetchAssocField("SELECT `term_taxonomy_id` FROM `".$this->shop->prefix."term_taxonomy` ");
-			
+
 			foreach ($arTermTaxonomyID as $term_taxonomy_id)
 			{
 
 				$count = $this->db->fetchOne("SELECT COUNT(*) FROM `".$this->shop->prefix."term_relationships` WHERE `term_taxonomy_id` = '".wpsg_q($term_taxonomy_id)."'");
-				
+
 				$this->db->UpdateQuery($this->shop->prefix.'term_taxonomy', array(
-					'count' => wpsg_q($count)			
+					'count' => wpsg_q($count)
 				), " `term_taxonomy_id` = '".wpsg_q($term_taxonomy_id)."' ");
-				
-			}
-			
+
+			}
+
 		} // private function updateTaxonomieCount()
-		
+
 		/**
 		 * Aktualisiert das Post Thumbnail (Beitragsbild)
@@ -845,17 +845,17 @@
 		public function updatePostThumbnail($product_id)
 		{
-						
+
 			// Wenn das Produktbildermodul inaktiv ist, muss ich hier nichts machen
 			// Oder wenn Option nicht aktiv
 			if (!$this->shop->hasMod('wpsg_mod_produktbilder') || !wpsg_isSizedInt($this->shop->get_option('wpsg_mod_produktartikel_postthumbnail'))) return;
-			
+
 			$post_id = $this->getPostIdFromProductId($product_id);	// Parent-ID
-			
+
 			if ($post_id !== false)
 			{
-				
+
 				// ID des bestehenden POST Thumbnail
 				$post_thumbnail_id = get_post_thumbnail_id($post_id);
-				
+
 				// Die Bilder mÃŒssen in extra Ordner liegen, da Wordpress auch die skallierten Bilder dort ablegt
 				$path_post_thumbnail = $this->shop->callMod('wpsg_mod_produktbilder', 'getPicPath', array($product_id)).'postthumbnail/';
@@ -867,15 +867,15 @@
 				if (wpsg_isSizedInt($post_thumbnail_id))
 				{
-					
+
 					// Postmeta Typ _thumbnail_id lÃ¶schen
 					delete_post_thumbnail($post_id);
 					// Postmeta Typ _wp_attachment_metadata und _wp_attached_file und Post lÃ¶schen
 					wp_delete_attachment($post_thumbnail_id);
-					
-				}
-				// Medium weil sonst $attach_data['size'] 0 ist 
+
+				}
+				// Medium weil sonst $attach_data['size'] 0 ist
 				$arBilder = $this->shop->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($product_id, 'thumbnail'));
 				//$arBilder = $this->shop->callMod('wpsg_mod_produktbilder', 'getProduktBilder', array($product_id));
-				
+
 				if (wpsg_isSizedArray($arBilder))
 				{
@@ -891,5 +891,5 @@
 					$fileurl = pathinfo($arBilder[0]['guid'])['dirname'].'/'.$imgdest;
 					$fileurl = pathinfo($arBilder[0]['guid'])['dirname'].'/'.$imgsrc;
-						
+
 					//$img_file = array_shift($arBilder);
 					$img_file = $imgsrc;
@@ -897,19 +897,19 @@
 					// C:\xampp\htdocs\wp2\wp-content\uploads\wpsg\wpsg_produktbilder\6\hdoval-2-300x300.png
 					//$filename = $this->shop->callMod('wpsg_mod_produktbilder', 'getPicPath', array($product_id)).$img_file;
-					
+
 					if (!file_exists($path_post_thumbnail)) mkdir($path_post_thumbnail, 0777, true);
-				
+
 					if (file_exists($path_post_thumbnail))
 					{
-						 
+
 						copy($filename, $path_post_thumbnail.$img_file);
-						
+
 						if (file_exists($path_post_thumbnail.$img_file))
 						{
-						
+
 							$filetype = wp_check_filetype($img_file, null);
 							// http://shop4.home/wp-content/uploads/wpsg/wpsg_produktbilder/6/posthumbnail/hdoval-2-150x150.png
 							//$fileurl = $this->shop->callMod('wpsg_mod_produktbilder', 'getPicPath', array($product_id, true)).'posthumbnail/'.$img_file;
-							
+
 							$attachment = array(
 								'guid' => $fileurl,
@@ -921,24 +921,24 @@
 							// Post und Postmeta Typ _wp_attached_file anlegen
 							$attach_id = wp_insert_attachment($attachment, $path_post_thumbnail.$img_file, $post_id);
-							
+
 							// Meta Daten schreiben
 							require_once(ABSPATH.'wp-admin/includes/image.php');
-							
-							// Postmeta Typ _wp_attachment_metadata anlegen								
+
+							// Postmeta Typ _wp_attachment_metadata anlegen
 							$attach_data = wp_generate_attachment_metadata($attach_id, $path_post_thumbnail.$img_file);
 							wp_update_attachment_metadata($attach_id, $attach_data);
-							
+
 							// Postmeta Typ _thumbnail_id anlegen
 							set_post_thumbnail($post_id, $attach_id);
-							
+
 						}
 					}
-						 					
-				}
-												
-			}
-			
+
+				}
+
+			}
+
 		} // private function updatePostThumbnail($product_id)
-		
+
 		/**
 		 * Gibt die Post_ID anhand einer ProduktID zurÃŒck.
@@ -947,7 +947,7 @@
 		private function getPostIdFromProductId($product_id, $path = false, $comment_status = false, $menu_order = false, $update = false)
 		{
-			
+
 			global $wpdb, $current_user;
-			
+
 			$post_id = $this->db->fetchOne("
 				SELECT
@@ -959,43 +959,43 @@
 					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
 			");
-			
+
 			if (wpsg_isSizedInt($post_id) && $update !== true) return $post_id;
-			else 
+			else
 			{
 
 				// Hier wird der CustomPost Type angelegt
 				$product = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($product_id)."'");
-				 				
+
 				$arLanguages = $this->shop->getStoreLanguages();
-				
+
 				if (wpsg_isSizedArray($arLanguages) && sizeof($arLanguages) > 1)
 				{
-	
+
 					if (function_exists('icl_object_id')) //if (is_plugin_active('sitepress-multilingual-cms/sitepress.php'))
 					{
-					
+
 						// WPML speichert in extra Post, hier nichts machen
 						$post_title = $product['name'];
 						$post_content = $this->shop->renderProdukt($product_id);
-						
+
 					}
 					else
 					{
-						
+
 						// Fallback fÃŒr qTranslate => Alle Sprachen in einen Post
-					
+
 						$post_title = '';
 						$post_content = '';
-						
+
 						// Titel der Ãbersetzten Produkte heraussuchen
 						foreach ($arLanguages as $l)
 						{
-							
+
 							$produkt_trans = $this->db->fetchRow("SELECT `id`, `name` FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_code` = '".wpsg_q($l['lang'])."' AND `lang_parent` = '".wpsg_q($product_id)."'");
-							
+
 							if ($produkt_trans['id'] > 0) // Ãbersetzung existiert					{
 							{
 								$post_title .= '<!--:'.$l['lang'].'-->'.$produkt_trans['name'].'<!--:-->';
-								$post_content .= '<!--:'.$l['lang'].'-->'.$this->shop->renderProdukt($product_id, false, $l['locale']).'<!--:-->';						
+								$post_content .= '<!--:'.$l['lang'].'-->'.$this->shop->renderProdukt($product_id, false, $l['locale']).'<!--:-->';
 							}
 							else // Ãbersetzung existiert nicht, hier trage ich einfach den Originaltext ein
@@ -1004,77 +1004,77 @@
 								$post_content .= '<!--:'.$l['lang'].'-->'.$this->shop->renderProdukt($product_id).'<!--:-->';
 							}
-							
+
 						}
-						
+
 					}
-					
+
 				}
 				else
 				{
-					
+
 					$post_title = $product['name'];
 					$post_content = $this->shop->renderProdukt($product_id);
-					
-				}
-				
+
+				}
+
 				$post_content = $this->clear_post_content($post_content);
-				
+
 				$data = array(
-					"post_title" => wpsg_q($post_title), 
-					'post_author' => $current_user->ID,				
+					"post_title" => wpsg_q($post_title),
+					'post_author' => $current_user->ID,
 					'post_content' => wpsg_q($post_content),
 					"post_type" => wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey')),
-					"wpsg_produkt_id" => wpsg_q($product_id),  
+					"wpsg_produkt_id" => wpsg_q($product_id),
 					"post_modified" => "NOW()",
 					"post_modified_gmt" => "NOW()"
 				);
-				
+
 				if ($comment_status !== false) $data['comment_status'] = wpsg_q(((wpsg_isSizedInt($comment_status))?'open':'closed'));
 				if ($menu_order !== false) $data['menu_order'] = $menu_order;
-				 
+
 				if ($post_id <= 0)
 				{
-					
+
 					$data['post_date'] = $product['cdate'];
 					$post_id = $this->db->ImportQuery($this->shop->prefix.'posts', $data);
-									
+
 				}
 				else
 				{
-									
+
 					$this->db->UpdateQuery($this->shop->prefix.'posts', $data, "`id` = '".wpsg_q($post_id)."'");
-					
-				}
-				
+
+				}
+
 				if ($path !== false)
 				{
-				
+
 					if (!wpsg_isSizedString($path)) $path = $product['name'];
-					
+
 					// Pathkey
 					$data = array();
 					$data['post_name'] = wpsg_q($this->shop->clear($path, $post_id));
 					$this->db->UpdateQuery($this->shop->prefix.'posts', $data, "`id` = '".wpsg_q($post_id)."'");
-					
-				}
-				
+
+				}
+
 				// Kategorie speichern
 				if (!wpsg_isSizedString($_REQUEST['wpsg_lang']))
 				{
-				
+
 					// Die Kategorie darf nur beim speichern in der Originalsprache gesetzt werden!
-					
+
 					// Alte Zuordnung lÃ¶schen
 					$this->db->Query("DELETE FROM `".$this->shop->prefix."term_relationships` WHERE `object_id` = '".wpsg_q($post_id)."'");
-					
+
 					// Neue Zuordnung speichern
 					if (wpsg_isSizedArray($_REQUEST['tax_input']['wpsgtax']))
 					{
-						
+
 						foreach ($_REQUEST['tax_input']['wpsgtax'] as $c)
 						{
-							
+
 							$term_taxonomy_id = $this->db->fetchOne("SELECT `term_taxonomy_id` FROM `".$this->shop->prefix."term_taxonomy` WHERE `term_id` = '".wpsg_q($c)."'");
-							
+
 							$this->db->ImportQuery($this->shop->prefix.'term_relationships', array(
 								'object_id' => wpsg_q($post_id),
@@ -1082,36 +1082,36 @@
 								'term_order' => '0'
 							));
-							
+
 							$count = $this->db->fetchOne("SELECT COUNT(*) FROM `".$this->shop->prefix."term_relationships` WHERE `term_taxonomy_id` = '".wpsg_q($term_taxonomy_id)."'");
-							
+
 							$this->db->UpdateQuery($this->shop->prefix."term_taxonomy", array(
 								'count' => wpsg_q($count)
 							), "`term_taxonomy_id` = '".wpsg_q($term_taxonomy_id)."'");
-							
+
 						}
-						
+
 					}
-					 
+
 					$this->updateTaxonomieCount();
-					
-				}
-				
+
+				}
+
 				$this->updatePostThumbnail($product_id);
-				
+
 				flush_rewrite_rules();
-				
+
 				return $post_id;
 
 			}
-			
+
 		} // private function getPostIdFromProductId($product_id)
-		
-		private function clear_post_content($post_content) 
-		{
-			
-			return strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '', $post_content)); 
-			
+
+		private function clear_post_content($post_content)
+		{
+
+			return strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '', $post_content));
+
 		} // private function clear_post_content($post_content)
-		
+
 		/**
 		 * FÃŒgt die Abfrage fÃŒr den PostType an den Wordpress Query
@@ -1119,5 +1119,5 @@
 		private function setPostType($query)
 		{
-			
+
 			$post_type = $query->get('post_type');
 
@@ -1131,24 +1131,24 @@
 					$this->shop->get_option('wpsg_mod_produktartikel_pathkey')
 				);
-				
+
 				if (is_string($post_type) && strlen($post_type) > 0)
 				{
 					$postType[] = $post_type;
 				}
-				
+
 				$query->set('post_type', $postType);
-				
+
 			}
 			else
 			{
-				
+
 				$post_type[] = $this->shop->get_option('wpsg_mod_produktartikel_pathkey');
-				
+
 				$query->set('post_type', $post_type);
-				
-			}
-			
+
+			}
+
 		} // private function setPostType($query)
-				
+
 		/**
 		 * Wird vom Produkttemplate aufgerufen um die Social Media Links einzubinden
@@ -1156,9 +1156,9 @@
 		public function socialIntegration($produkt_id)
 		{
-            
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_produktartikel/produkt.phtml');
-			
+
 		} // public function socialIntegration($produkt_id)
-		
+
 		/**
 		 * Gibt einen Array mit Kategorien zurÃŒck
@@ -1166,15 +1166,15 @@
 		public function getCategorySelectArray($ref = 0, $ebene = 0, &$arReturn = array())
 		{
-			
+
 			global $wpdb;
-			
+
 			$arCat = $this->db->fetchAssoc("
-				SELECT 
-					T.`term_id`, T.`name` 
-				FROM 
+				SELECT
+					T.`term_id`, T.`name`
+				FROM
 					`".$this->shop->prefix."term_taxonomy` AS TT
 						LEFT JOIN `".$this->shop->prefix."terms` AS T ON (T.`term_id` = TT.`term_id`)
-				WHERE 
-					TT.`parent` = '".wpsg_q($ref)."' AND 
+				WHERE
+					TT.`parent` = '".wpsg_q($ref)."' AND
 					TT.`taxonomy` = 'wpsgtax' AND
 					T.`term_id` > 0
@@ -1186,18 +1186,18 @@
 			{
 
-				$cat_name = '';				
-				for ($i = 0; $i < $ebene; $i ++) $cat_name .= '-';				
+				$cat_name = '';
+				for ($i = 0; $i < $ebene; $i ++) $cat_name .= '-';
 				$cat_name .= $c['name'];
-				
+
 				$arReturn[$c['term_id']] = $cat_name;
-				
+
 				$this->getCategorySelectArray($c['term_id'], $ebene + 1, $arReturn);
-				
-			}
-			
+
+			}
+
 			return $arReturn;
-			
+
 		} // public function getCategorySelectArray($ref = 0)
-	
+
 		/**
 		 * Gibt einen Array mit KategorieIDs die unter einer Kategorie liegen zurÃŒck
@@ -1205,5 +1205,5 @@
 		public function getSubCategoryID($child_of = 0)
 		{
-			
+
 			$arCat = get_categories(array(
 				'taxonomy' => 'wpsgtax',
@@ -1213,17 +1213,17 @@
 				'fields' => 'ids'
 			));
-			
+
 			$arCat[] = $child_of;
-			
+
 			return $arCat;
-			
+
 		} // public function getSubCategoryID($parent = 0)
-		
+
 		/**
-		 * Gibt einen Array mit Kategorien unterhalb zurÃŒck 
+		 * Gibt einen Array mit Kategorien unterhalb zurÃŒck
 		 */
 		public function getSubCategory($parent = 0)
 		{
-			
+
 			$arCat = get_categories(array(
 				'taxonomy' => 'wpsgtax',
@@ -1231,9 +1231,111 @@
 				'hide_empty' => true
 			));
-			
+
 			return $arCat;
-			
+
 		} // public function getSubCategory($parent = 0)
-		
+
+
+		/**
+		 * Gibt einen Array mit Kategorien zurÃŒck
+		 */
+		public function getProductcategorySelect0($ref = 0, $ebene = 0, &$arReturn = array())
+		{
+
+			global $wpdb;
+
+			$arCat = $this->db->fetchAssoc("
+				SELECT
+					T.`term_id`, T.`name`, TT.`parent`, TT.`count`
+				FROM
+					`".$this->shop->prefix."term_taxonomy` AS TT
+						LEFT JOIN `".$this->shop->prefix."terms` AS T ON (T.`term_id` = TT.`term_id`)
+				WHERE
+					TT.`parent` = '".wpsg_q($ref)."' AND
+					TT.`taxonomy` = 'wpsgtax' AND
+					T.`term_id` > 0
+				ORDER BY
+					T.`name` ASC
+			");
+
+			foreach ($arCat as $c)
+			{
+
+				$cat_name = '';
+				for ($i = 0; $i < $ebene; $i ++) $cat_name .= '-';
+				$cat_name .= $c['name'];
+
+				//$arReturn[$c['term_id']] = $cat_name;
+				$label = $c['name'].' ('.$c['count'].')';
+				$arReturn[] = array('term_id' => $c['term_id'],
+									'name' => $c['name'],
+									'label' => $label,
+									'cat_name' => $cat_name,
+									'parent' => $c['parent'],
+									'count' => $c['count']
+				);
+
+				$this->getProductcategorySelect($c['term_id'], $ebene + 1, $arReturn);
+
+			}
+
+			return $arReturn;
+
+		} // public function getProductcategorySelect($ref = 0)
+
+		public static function getProductcategorySelect($arProductFilter = array())
+		{
+
+			if (wpsg_isSizedArray($arProductFilter))
+			{
+
+				unset($arProductFilter['limit']);
+				unset($arProductFilter['page']);
+				unset($arProductFilter['status']);
+				unset($arProductFilter['productgroup_ids']);
+				unset($arProductFilter['productcategory_ids']);
+
+				list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = wpsg_product::getQueryParts($arProductFilter);
+
+				$strQuery = "
+					SELECT T.`term_id`, T.`name`, P.`name` AS pname, TR.`term_taxonomy_id`,
+					COUNT( T.`term_id` ) AS anzahl
+					FROM `".$GLOBALS['wpsg_sc']->prefix."terms` AS T, `".$GLOBALS['wpsg_sc']->prefix."term_taxonomy` AS TT,
+					`".$GLOBALS['wpsg_sc']->prefix."term_relationships` AS TR, `".$GLOBALS['wpsg_sc']->prefix."posts` AS PO, `".WPSG_TBL_PRODUCTS."` AS P
+					WHERE T.`term_id` = TT.`term_id` AND TT.`term_taxonomy_id` = TR.`term_taxonomy_id` AND TR.`object_id` = PO.`ID` AND
+					PO.`wpsg_produkt_id` = P.`id` ".$strQueryWHERE."
+					GROUP BY T.`term_id`, T.`name`
+				";
+
+				$temp = $GLOBALS['wpsg_db']->fetchAssoc($strQuery);
+				foreach ($temp AS &$v)
+					$v['label'] = $v['name'].' ('.$v['anzahl'].')';
+				return $temp;
+
+
+				//return $GLOBALS['wpsg_db']->fetchAssocField($strQuery, "id", "name");
+
+			}
+			else
+			{
+
+				$strQuery = "
+SELECT `wp_terms`.`term_id`, `wp_terms`.`name`, `wp_wpsg_products`.`name` AS pname,
+COUNT( `wp_terms`.`term_id` ) AS anzahl
+FROM `wp_terms`, `wp_term_taxonomy`, `wp_term_relationships`, `wp_posts`, `wp_wpsg_products`
+WHERE `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id` AND
+`wp_term_taxonomy`.`term_taxonomy_id` = `wp_term_relationships`.`term_taxonomy_id` AND
+`wp_term_relationships`.`object_id` = `wp_posts`.`ID` AND
+`wp_posts`.`wpsg_produkt_id` = `wp_wpsg_products`.`id` GROUP BY `wp_terms`.`term_id`, `wp_terms`.`name`
+				";
+
+				$temp = $GLOBALS['wpsg_db']->fetchAssoc($strQuery);
+				foreach ($temp AS &$v)
+					$v['label'] = $v['name'].' ('.$v['anzahl'].')';
+				return $temp;
+			}
+
+		} // public static function getProductcategorySelect()
+
 	} // class wpsg_mod_produktartikel extends wpsg_mod_basic
 
Index: /views/admin/includes.phtml
===================================================================
--- /views/admin/includes.phtml	(revision 6337)
+++ /views/admin/includes.phtml	(revision 6338)
@@ -7,19 +7,19 @@
 ?>
 <div class="wpsg_admin_submenu">
-	
+
 	<div class="list-group">
-		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>		
-		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>		 
-		<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>		
+		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>
+		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
+		<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
 		<?php } ?>
-	</div> 
-			
+	</div>
+
 </div>
 
 <div class="wpsg_admin_content form-horizontal">
 	<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=includes&noheader=1'; ?>">
-		
+
 		<?php echo wpsg_drawForm_AdminboxStart(__('Bibliotheken/Includes', 'wpsg')); ?>
-			
+
 			<?php echo wpsg_drawForm_Checkbox('wpsg_load_css', __('Shop CSS styles nicht einbinden', 'wpsg'), $this->get_option('wpsg_load_css'), array('help' => 'wpsg_load_css')); ?>
 			<?php echo wpsg_drawForm_Checkbox('wpsg_load_jquery', __('JQuery einbinden', 'wpsg'), $this->get_option('wpsg_load_jquery'), array('help' => 'wpsg_load_jquery')); ?>
@@ -28,11 +28,12 @@
 			<?php echo wpsg_drawForm_Checkbox('wpsg_load_validierung_js', __('Javascript Validierung laden', 'wpsg'), $this->get_option('wpsg_load_validierung_js'), array('help' => 'wpsg_load_validierung')); ?>
 			<?php echo wpsg_drawForm_Checkbox('wpsg_load_validierung_css', __('CSS der Javascript Validierung laden', 'wpsg'), $this->get_option('wpsg_load_validierung_css'), array('help' => 'wpsg_load_validierung')); ?>
-			
+			<?php echo wpsg_drawForm_Checkbox('wpsg_load_bootstrap_glyphfont_css', __('Bootstrap Glyphfont CSS im Frontend laden', 'wpsg'), $this->get_option('wpsg_load_bootstrap_glyphfont_css'), array('help' => 'wpsg_load_bootstrap_glyphfont_css')); ?>
+
 			<?php $this->callMods('admin_includes'); ?>
-	
+
 		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
-			
+
 		<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" /></p>
-		
+
 	</form>
 </div>
Index: /views/css/frontend.css
===================================================================
--- /views/css/frontend.css	(revision 6337)
+++ /views/css/frontend.css	(revision 6338)
@@ -52,7 +52,8 @@
 .basket_sum_wrap .basket_sum_row .sum { width: 20%; display:inline-block; font-weight:bold; text-align:right; }
 .basket_sum_wrap .basket_sum_row .delgs { width: 20%; display:inline-block; font-weight:normal; text-align:right; }
-.basket_sum_wrap .basket_sum_row .codegs { width: 34%; display:inline-block; font-weight:normal; text-align:left; }
-.basket_sum_wrap .basket_sum_row .codegsl { width: 33%; display:inline-block; font-weight:normal; text-align:left; }
-.basket_sum_wrap .basket_sum_row .codegsr { width: 33%; display:inline-block; font-weight:normal; text-align:right; }
+.basket_sum_wrap .basket_sum_row .codegs { width: 40%; display:inline-block; font-weight:normal; text-align:left; }
+.basket_sum_wrap .basket_sum_row .codegsf { display:inline-block; font-weight:normal; text-align:left; }
+.basket_sum_wrap .basket_sum_row .codegsl { width: 30%; display:inline-block; font-weight:normal; text-align:left; }
+.basket_sum_wrap .basket_sum_row .codegsr { width: 30%; display:inline-block; font-weight:normal; text-align:right; }
 .basket_sum_wrap .basket_sum_row .colgsl { width: 20%; display:inline-block; font-weight:normal; text-align:left; }
 .basket_sum_wrap .basket_sum_row .colgsr { width: 20%; display:inline-block; font-weight:normal; text-align:right; }
@@ -61,11 +62,12 @@
 .basket_sum_wrap .wpsg_mod_basketteaser_row .valuer { width: 20%; display:inline-block; font-weight:normal; text-align:right; }
 .basket_sum_wrap .wpsg_mod_basketteaser_row .valuel { width: 20%; display:inline-block; font-weight:normal; text-align:left; }
-
-.wpsg_basket .wpsg_basket_removelink { float:right; text-decoration:none; border:0px !important; }
+.basket_sum_wrap .wpsg_gutschein_add {padding:0.75em 2em;}
+/* .glyphicon {width:20px !important; text-decoration:none; position:relative; display:inline-block; font-family:'Glyphicons Halflings'; line-height:1rem;} */
+
+.wpsg_basket .wpsg_basket_removelink { float:right; -webkit-box-shadow:none; box-shadow:none; text-decoration:none; border:0px !important; }
 .wpsg_basket .wpsg_checkoutbutton { float:right; }
 .wpsg_basket .wpsg_cell_gesamtsumme_value { font-weight:bold; }
 .wpsg_basket .wpsg_refreshbutton, .wpsg_basketbutton { float:left; }
-.wpsg_basket .wpsg_basket_weiter_shoppen2 {background:#1a1a1a none repeat scroll 0 0; border:0 none; border-radius:2px; color:#fff; font-weight:700; line-height:1; text-transform:uppercase; padding:0.85em 0.875em 0.78em;}
-
+.wpsg_basket .wpsg_basket_weiter_shoppen {background:#1a1a1a none repeat scroll 0 0; border:0 none; border-radius:2px; color:#fff; font-weight:700; line-height:1; text-transform:uppercase; padding:0.85em 0.875em 0.78em;}
 
 /* Checkout + Request*/
Index: /views/js/bootstrap-3.3.6-dist/css/bootstrap-glyphfont.css
===================================================================
--- /views/js/bootstrap-3.3.6-dist/css/bootstrap-glyphfont.css	(revision 6338)
+++ /views/js/bootstrap-3.3.6-dist/css/bootstrap-glyphfont.css	(revision 6338)
@@ -0,0 +1,811 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+@font-face {
+  font-family: 'Glyphicons Halflings';
+
+  src: url('../fonts/glyphicons-halflings-regular.eot');
+  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
+}
+.glyphicon {
+  position: relative;
+  top: 1px;
+  display: inline-block;
+  font-family: 'Glyphicons Halflings';
+  font-style: normal;
+  font-weight: normal;
+  line-height: 1;
+
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+.glyphicon-asterisk:before {
+  content: "\002a";
+}
+.glyphicon-plus:before {
+  content: "\002b";
+}
+.glyphicon-euro:before,
+.glyphicon-eur:before {
+  content: "\20ac";
+}
+.glyphicon-minus:before {
+  content: "\2212";
+}
+.glyphicon-cloud:before {
+  content: "\2601";
+}
+.glyphicon-envelope:before {
+  content: "\2709";
+}
+.glyphicon-pencil:before {
+  content: "\270f";
+}
+.glyphicon-glass:before {
+  content: "\e001";
+}
+.glyphicon-music:before {
+  content: "\e002";
+}
+.glyphicon-search:before {
+  content: "\e003";
+}
+.glyphicon-heart:before {
+  content: "\e005";
+}
+.glyphicon-star:before {
+  content: "\e006";
+}
+.glyphicon-star-empty:before {
+  content: "\e007";
+}
+.glyphicon-user:before {
+  content: "\e008";
+}
+.glyphicon-film:before {
+  content: "\e009";
+}
+.glyphicon-th-large:before {
+  content: "\e010";
+}
+.glyphicon-th:before {
+  content: "\e011";
+}
+.glyphicon-th-list:before {
+  content: "\e012";
+}
+.glyphicon-ok:before {
+  content: "\e013";
+}
+.glyphicon-remove:before {
+  content: "\e014";
+}
+.glyphicon-zoom-in:before {
+  content: "\e015";
+}
+.glyphicon-zoom-out:before {
+  content: "\e016";
+}
+.glyphicon-off:before {
+  content: "\e017";
+}
+.glyphicon-signal:before {
+  content: "\e018";
+}
+.glyphicon-cog:before {
+  content: "\e019";
+}
+.glyphicon-trash:before {
+  content: "\e020";
+}
+.glyphicon-home:before {
+  content: "\e021";
+}
+.glyphicon-file:before {
+  content: "\e022";
+}
+.glyphicon-time:before {
+  content: "\e023";
+}
+.glyphicon-road:before {
+  content: "\e024";
+}
+.glyphicon-download-alt:before {
+  content: "\e025";
+}
+.glyphicon-download:before {
+  content: "\e026";
+}
+.glyphicon-upload:before {
+  content: "\e027";
+}
+.glyphicon-inbox:before {
+  content: "\e028";
+}
+.glyphicon-play-circle:before {
+  content: "\e029";
+}
+.glyphicon-repeat:before {
+  content: "\e030";
+}
+.glyphicon-refresh:before {
+  content: "\e031";
+}
+.glyphicon-list-alt:before {
+  content: "\e032";
+}
+.glyphicon-lock:before {
+  content: "\e033";
+}
+.glyphicon-flag:before {
+  content: "\e034";
+}
+.glyphicon-headphones:before {
+  content: "\e035";
+}
+.glyphicon-volume-off:before {
+  content: "\e036";
+}
+.glyphicon-volume-down:before {
+  content: "\e037";
+}
+.glyphicon-volume-up:before {
+  content: "\e038";
+}
+.glyphicon-qrcode:before {
+  content: "\e039";
+}
+.glyphicon-barcode:before {
+  content: "\e040";
+}
+.glyphicon-tag:before {
+  content: "\e041";
+}
+.glyphicon-tags:before {
+  content: "\e042";
+}
+.glyphicon-book:before {
+  content: "\e043";
+}
+.glyphicon-bookmark:before {
+  content: "\e044";
+}
+.glyphicon-print:before {
+  content: "\e045";
+}
+.glyphicon-camera:before {
+  content: "\e046";
+}
+.glyphicon-font:before {
+  content: "\e047";
+}
+.glyphicon-bold:before {
+  content: "\e048";
+}
+.glyphicon-italic:before {
+  content: "\e049";
+}
+.glyphicon-text-height:before {
+  content: "\e050";
+}
+.glyphicon-text-width:before {
+  content: "\e051";
+}
+.glyphicon-align-left:before {
+  content: "\e052";
+}
+.glyphicon-align-center:before {
+  content: "\e053";
+}
+.glyphicon-align-right:before {
+  content: "\e054";
+}
+.glyphicon-align-justify:before {
+  content: "\e055";
+}
+.glyphicon-list:before {
+  content: "\e056";
+}
+.glyphicon-indent-left:before {
+  content: "\e057";
+}
+.glyphicon-indent-right:before {
+  content: "\e058";
+}
+.glyphicon-facetime-video:before {
+  content: "\e059";
+}
+.glyphicon-picture:before {
+  content: "\e060";
+}
+.glyphicon-map-marker:before {
+  content: "\e062";
+}
+.glyphicon-adjust:before {
+  content: "\e063";
+}
+.glyphicon-tint:before {
+  content: "\e064";
+}
+.glyphicon-edit:before {
+  content: "\e065";
+}
+.glyphicon-share:before {
+  content: "\e066";
+}
+.glyphicon-check:before {
+  content: "\e067";
+}
+.glyphicon-move:before {
+  content: "\e068";
+}
+.glyphicon-step-backward:before {
+  content: "\e069";
+}
+.glyphicon-fast-backward:before {
+  content: "\e070";
+}
+.glyphicon-backward:before {
+  content: "\e071";
+}
+.glyphicon-play:before {
+  content: "\e072";
+}
+.glyphicon-pause:before {
+  content: "\e073";
+}
+.glyphicon-stop:before {
+  content: "\e074";
+}
+.glyphicon-forward:before {
+  content: "\e075";
+}
+.glyphicon-fast-forward:before {
+  content: "\e076";
+}
+.glyphicon-step-forward:before {
+  content: "\e077";
+}
+.glyphicon-eject:before {
+  content: "\e078";
+}
+.glyphicon-chevron-left:before {
+  content: "\e079";
+}
+.glyphicon-chevron-right:before {
+  content: "\e080";
+}
+.glyphicon-plus-sign:before {
+  content: "\e081";
+}
+.glyphicon-minus-sign:before {
+  content: "\e082";
+}
+.glyphicon-remove-sign:before {
+  content: "\e083";
+}
+.glyphicon-ok-sign:before {
+  content: "\e084";
+}
+.glyphicon-question-sign:before {
+  content: "\e085";
+}
+.glyphicon-info-sign:before {
+  content: "\e086";
+}
+.glyphicon-screenshot:before {
+  content: "\e087";
+}
+.glyphicon-remove-circle:before {
+  content: "\e088";
+}
+.glyphicon-ok-circle:before {
+  content: "\e089";
+}
+.glyphicon-ban-circle:before {
+  content: "\e090";
+}
+.glyphicon-arrow-left:before {
+  content: "\e091";
+}
+.glyphicon-arrow-right:before {
+  content: "\e092";
+}
+.glyphicon-arrow-up:before {
+  content: "\e093";
+}
+.glyphicon-arrow-down:before {
+  content: "\e094";
+}
+.glyphicon-share-alt:before {
+  content: "\e095";
+}
+.glyphicon-resize-full:before {
+  content: "\e096";
+}
+.glyphicon-resize-small:before {
+  content: "\e097";
+}
+.glyphicon-exclamation-sign:before {
+  content: "\e101";
+}
+.glyphicon-gift:before {
+  content: "\e102";
+}
+.glyphicon-leaf:before {
+  content: "\e103";
+}
+.glyphicon-fire:before {
+  content: "\e104";
+}
+.glyphicon-eye-open:before {
+  content: "\e105";
+}
+.glyphicon-eye-close:before {
+  content: "\e106";
+}
+.glyphicon-warning-sign:before {
+  content: "\e107";
+}
+.glyphicon-plane:before {
+  content: "\e108";
+}
+.glyphicon-calendar:before {
+  content: "\e109";
+}
+.glyphicon-random:before {
+  content: "\e110";
+}
+.glyphicon-comment:before {
+  content: "\e111";
+}
+.glyphicon-magnet:before {
+  content: "\e112";
+}
+.glyphicon-chevron-up:before {
+  content: "\e113";
+}
+.glyphicon-chevron-down:before {
+  content: "\e114";
+}
+.glyphicon-retweet:before {
+  content: "\e115";
+}
+.glyphicon-shopping-cart:before {
+  content: "\e116";
+}
+.glyphicon-folder-close:before {
+  content: "\e117";
+}
+.glyphicon-folder-open:before {
+  content: "\e118";
+}
+.glyphicon-resize-vertical:before {
+  content: "\e119";
+}
+.glyphicon-resize-horizontal:before {
+  content: "\e120";
+}
+.glyphicon-hdd:before {
+  content: "\e121";
+}
+.glyphicon-bullhorn:before {
+  content: "\e122";
+}
+.glyphicon-bell:before {
+  content: "\e123";
+}
+.glyphicon-certificate:before {
+  content: "\e124";
+}
+.glyphicon-thumbs-up:before {
+  content: "\e125";
+}
+.glyphicon-thumbs-down:before {
+  content: "\e126";
+}
+.glyphicon-hand-right:before {
+  content: "\e127";
+}
+.glyphicon-hand-left:before {
+  content: "\e128";
+}
+.glyphicon-hand-up:before {
+  content: "\e129";
+}
+.glyphicon-hand-down:before {
+  content: "\e130";
+}
+.glyphicon-circle-arrow-right:before {
+  content: "\e131";
+}
+.glyphicon-circle-arrow-left:before {
+  content: "\e132";
+}
+.glyphicon-circle-arrow-up:before {
+  content: "\e133";
+}
+.glyphicon-circle-arrow-down:before {
+  content: "\e134";
+}
+.glyphicon-globe:before {
+  content: "\e135";
+}
+.glyphicon-wrench:before {
+  content: "\e136";
+}
+.glyphicon-tasks:before {
+  content: "\e137";
+}
+.glyphicon-filter:before {
+  content: "\e138";
+}
+.glyphicon-briefcase:before {
+  content: "\e139";
+}
+.glyphicon-fullscreen:before {
+  content: "\e140";
+}
+.glyphicon-dashboard:before {
+  content: "\e141";
+}
+.glyphicon-paperclip:before {
+  content: "\e142";
+}
+.glyphicon-heart-empty:before {
+  content: "\e143";
+}
+.glyphicon-link:before {
+  content: "\e144";
+}
+.glyphicon-phone:before {
+  content: "\e145";
+}
+.glyphicon-pushpin:before {
+  content: "\e146";
+}
+.glyphicon-usd:before {
+  content: "\e148";
+}
+.glyphicon-gbp:before {
+  content: "\e149";
+}
+.glyphicon-sort:before {
+  content: "\e150";
+}
+.glyphicon-sort-by-alphabet:before {
+  content: "\e151";
+}
+.glyphicon-sort-by-alphabet-alt:before {
+  content: "\e152";
+}
+.glyphicon-sort-by-order:before {
+  content: "\e153";
+}
+.glyphicon-sort-by-order-alt:before {
+  content: "\e154";
+}
+.glyphicon-sort-by-attributes:before {
+  content: "\e155";
+}
+.glyphicon-sort-by-attributes-alt:before {
+  content: "\e156";
+}
+.glyphicon-unchecked:before {
+  content: "\e157";
+}
+.glyphicon-expand:before {
+  content: "\e158";
+}
+.glyphicon-collapse-down:before {
+  content: "\e159";
+}
+.glyphicon-collapse-up:before {
+  content: "\e160";
+}
+.glyphicon-log-in:before {
+  content: "\e161";
+}
+.glyphicon-flash:before {
+  content: "\e162";
+}
+.glyphicon-log-out:before {
+  content: "\e163";
+}
+.glyphicon-new-window:before {
+  content: "\e164";
+}
+.glyphicon-record:before {
+  content: "\e165";
+}
+.glyphicon-save:before {
+  content: "\e166";
+}
+.glyphicon-open:before {
+  content: "\e167";
+}
+.glyphicon-saved:before {
+  content: "\e168";
+}
+.glyphicon-import:before {
+  content: "\e169";
+}
+.glyphicon-export:before {
+  content: "\e170";
+}
+.glyphicon-send:before {
+  content: "\e171";
+}
+.glyphicon-floppy-disk:before {
+  content: "\e172";
+}
+.glyphicon-floppy-saved:before {
+  content: "\e173";
+}
+.glyphicon-floppy-remove:before {
+  content: "\e174";
+}
+.glyphicon-floppy-save:before {
+  content: "\e175";
+}
+.glyphicon-floppy-open:before {
+  content: "\e176";
+}
+.glyphicon-credit-card:before {
+  content: "\e177";
+}
+.glyphicon-transfer:before {
+  content: "\e178";
+}
+.glyphicon-cutlery:before {
+  content: "\e179";
+}
+.glyphicon-header:before {
+  content: "\e180";
+}
+.glyphicon-compressed:before {
+  content: "\e181";
+}
+.glyphicon-earphone:before {
+  content: "\e182";
+}
+.glyphicon-phone-alt:before {
+  content: "\e183";
+}
+.glyphicon-tower:before {
+  content: "\e184";
+}
+.glyphicon-stats:before {
+  content: "\e185";
+}
+.glyphicon-sd-video:before {
+  content: "\e186";
+}
+.glyphicon-hd-video:before {
+  content: "\e187";
+}
+.glyphicon-subtitles:before {
+  content: "\e188";
+}
+.glyphicon-sound-stereo:before {
+  content: "\e189";
+}
+.glyphicon-sound-dolby:before {
+  content: "\e190";
+}
+.glyphicon-sound-5-1:before {
+  content: "\e191";
+}
+.glyphicon-sound-6-1:before {
+  content: "\e192";
+}
+.glyphicon-sound-7-1:before {
+  content: "\e193";
+}
+.glyphicon-copyright-mark:before {
+  content: "\e194";
+}
+.glyphicon-registration-mark:before {
+  content: "\e195";
+}
+.glyphicon-cloud-download:before {
+  content: "\e197";
+}
+.glyphicon-cloud-upload:before {
+  content: "\e198";
+}
+.glyphicon-tree-conifer:before {
+  content: "\e199";
+}
+.glyphicon-tree-deciduous:before {
+  content: "\e200";
+}
+.glyphicon-cd:before {
+  content: "\e201";
+}
+.glyphicon-save-file:before {
+  content: "\e202";
+}
+.glyphicon-open-file:before {
+  content: "\e203";
+}
+.glyphicon-level-up:before {
+  content: "\e204";
+}
+.glyphicon-copy:before {
+  content: "\e205";
+}
+.glyphicon-paste:before {
+  content: "\e206";
+}
+.glyphicon-alert:before {
+  content: "\e209";
+}
+.glyphicon-equalizer:before {
+  content: "\e210";
+}
+.glyphicon-king:before {
+  content: "\e211";
+}
+.glyphicon-queen:before {
+  content: "\e212";
+}
+.glyphicon-pawn:before {
+  content: "\e213";
+}
+.glyphicon-bishop:before {
+  content: "\e214";
+}
+.glyphicon-knight:before {
+  content: "\e215";
+}
+.glyphicon-baby-formula:before {
+  content: "\e216";
+}
+.glyphicon-tent:before {
+  content: "\26fa";
+}
+.glyphicon-blackboard:before {
+  content: "\e218";
+}
+.glyphicon-bed:before {
+  content: "\e219";
+}
+.glyphicon-apple:before {
+  content: "\f8ff";
+}
+.glyphicon-erase:before {
+  content: "\e221";
+}
+.glyphicon-hourglass:before {
+  content: "\231b";
+}
+.glyphicon-lamp:before {
+  content: "\e223";
+}
+.glyphicon-duplicate:before {
+  content: "\e224";
+}
+.glyphicon-piggy-bank:before {
+  content: "\e225";
+}
+.glyphicon-scissors:before {
+  content: "\e226";
+}
+.glyphicon-bitcoin:before {
+  content: "\e227";
+}
+.glyphicon-btc:before {
+  content: "\e227";
+}
+.glyphicon-xbt:before {
+  content: "\e227";
+}
+.glyphicon-yen:before {
+  content: "\00a5";
+}
+.glyphicon-jpy:before {
+  content: "\00a5";
+}
+.glyphicon-ruble:before {
+  content: "\20bd";
+}
+.glyphicon-rub:before {
+  content: "\20bd";
+}
+.glyphicon-scale:before {
+  content: "\e230";
+}
+.glyphicon-ice-lolly:before {
+  content: "\e231";
+}
+.glyphicon-ice-lolly-tasted:before {
+  content: "\e232";
+}
+.glyphicon-education:before {
+  content: "\e233";
+}
+.glyphicon-option-horizontal:before {
+  content: "\e234";
+}
+.glyphicon-option-vertical:before {
+  content: "\e235";
+}
+.glyphicon-menu-hamburger:before {
+  content: "\e236";
+}
+.glyphicon-modal-window:before {
+  content: "\e237";
+}
+.glyphicon-oil:before {
+  content: "\e238";
+}
+.glyphicon-grain:before {
+  content: "\e239";
+}
+.glyphicon-sunglasses:before {
+  content: "\e240";
+}
+.glyphicon-text-size:before {
+  content: "\e241";
+}
+.glyphicon-text-color:before {
+  content: "\e242";
+}
+.glyphicon-text-background:before {
+  content: "\e243";
+}
+.glyphicon-object-align-top:before {
+  content: "\e244";
+}
+.glyphicon-object-align-bottom:before {
+  content: "\e245";
+}
+.glyphicon-object-align-horizontal:before {
+  content: "\e246";
+}
+.glyphicon-object-align-left:before {
+  content: "\e247";
+}
+.glyphicon-object-align-vertical:before {
+  content: "\e248";
+}
+.glyphicon-object-align-right:before {
+  content: "\e249";
+}
+.glyphicon-triangle-right:before {
+  content: "\e250";
+}
+.glyphicon-triangle-left:before {
+  content: "\e251";
+}
+.glyphicon-triangle-bottom:before {
+  content: "\e252";
+}
+.glyphicon-triangle-top:before {
+  content: "\e253";
+}
+.glyphicon-console:before {
+  content: "\e254";
+}
+.glyphicon-superscript:before {
+  content: "\e255";
+}
+.glyphicon-subscript:before {
+  content: "\e256";
+}
+.glyphicon-menu-left:before {
+  content: "\e257";
+}
+.glyphicon-menu-right:before {
+  content: "\e258";
+}
+.glyphicon-menu-down:before {
+  content: "\e259";
+}
+.glyphicon-menu-up:before {
+  content: "\e260";
+}
Index: /views/mods/mod_basketteaser/basket_row.phtml
===================================================================
--- /views/mods/mod_basketteaser/basket_row.phtml	(revision 6337)
+++ /views/mods/mod_basketteaser/basket_row.phtml	(revision 6338)
@@ -31,2 +31,3 @@
 </div>
 <br />
+<div class="wpsg_spacer"></div>
Index: /views/mods/mod_discount/productgroups_addedit_sidebar.phtml
===================================================================
--- /views/mods/mod_discount/productgroups_addedit_sidebar.phtml	(revision 6337)
+++ /views/mods/mod_discount/productgroups_addedit_sidebar.phtml	(revision 6338)
@@ -13,7 +13,7 @@
 	<div class="inside">
 		<?php echo wpsg_drawForm_Checkbox('wpsg_mod_discount[discount_aktiv]', __('Aktion aktiv', 'wpsg'), $this->view['wpsg_mod_discount']['data'][0]); ?>
-		<?php echo wpsg_drawForm_Input('wpsg_mod_discount[discount_from]', __('Start (TT.MM.JJJJ)', 'wpsg'), wpsg_hspc($this->view['wpsg_mod_discount']['data'][1])); ?>
-		<?php echo wpsg_drawForm_Input('wpsg_mod_discount[discount_to]', __('Ende (TT.MM.JJJJ)', 'wpsg'), wpsg_hspc($this->view['wpsg_mod_discount']['data'][2])); ?>
-		<?php echo wpsg_drawForm_Input('wpsg_mod_discount[discount_value]', __('Rabatt', 'wpsg'), wpsg_ff($this->view['wpsg_mod_discount']['data'][3])); ?>
+		<?php echo wpsg_drawForm_Input('wpsg_mod_discount[discount_from]', __('Start (TT.MM.JJJJ)', 'wpsg'), wpsg_hspc(wpsg_getStr($this->view['wpsg_mod_discount']['data'][1]))); ?>
+		<?php echo wpsg_drawForm_Input('wpsg_mod_discount[discount_to]', __('Ende (TT.MM.JJJJ)', 'wpsg'), wpsg_hspc(wpsg_getStr($this->view['wpsg_mod_discount']['data'][2]))); ?>
+		<?php echo wpsg_drawForm_Input('wpsg_mod_discount[discount_value]', __('Rabatt', 'wpsg'), wpsg_ff(wpsg_getStr($this->view['wpsg_mod_discount']['data'][3]))); ?>
 	</div>
-</div>						
+</div>
Index: /views/mods/mod_gutschein/basket_row_end.phtml
===================================================================
--- /views/mods/mod_gutschein/basket_row_end.phtml	(revision 6337)
+++ /views/mods/mod_gutschein/basket_row_end.phtml	(revision 6338)
@@ -9,5 +9,5 @@
 <div class="basket_sum_row">
 	<div class="codegs">
-		<label for="wpsg_gutschein_input"><?php echo __('Gutscheincode:', 'wpsg'); ?></label>
+		<label class="codegsf" for="wpsg_gutschein_input"><?php echo __('Gutscheincode:', 'wpsg'); ?></label>
 	</div>
 	<div class="codegsl">
@@ -15,5 +15,5 @@
 	</div>
 	<div class="codegsr">
-		<input class="wpsg_gutschein_add wpsg_button" type="submit" name="wpsg_gutschein_add" value="<?php echo '&nbsp;'.__('EinlÃ¶sen', 'wpsg').'&nbsp;'; ?>" />
+		<input class="wpsg_button wpsg_gutschein_add" type="submit" name="wpsg_gutschein_add" value="<?php echo '&nbsp;'.__('EinlÃ¶sen', 'wpsg').'&nbsp;'; ?>" />
 	</div>
 </div>
Index: /views/produkt/index.phtml
===================================================================
--- /views/produkt/index.phtml	(revision 6337)
+++ /views/produkt/index.phtml	(revision 6338)
@@ -28,5 +28,5 @@
                     <?php } ?>
 					<?php } ?>
-			 	</ul>			 	
+			 	</ul>
 			</div>
 		</div>
@@ -35,26 +35,39 @@
 				<div class="col-lg-4">
 					<form method="post" id="filter_form">
-					
+
 						<input id="wpsg_seite" type="hidden" name="seite" value="<?php echo @$this->view['arFilter']['page']; ?>" class="current-page" />
 						<input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
 						<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
-										
+
 						<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
-                        
-                        <?php $filterAll = $this->view['arFilter']; unset($filterAll['productgroup_ids']); ?>
-                        
+
+                        <?php $filterAll = $this->view['arFilter'];
+                        	unset($filterAll['productgroup_ids']);
+                        	unset($filterAll['productcategory_ids']);
+                        ?>
+
                         <?php if ($this->hasMod('wpsg_mod_productgroups')) { ?>
                         <?php echo wpsg_drawForm_Select('filter[productgroup_ids]', __('Produktgruppe', 'wpsg'), wpsg_array_merge(array('-1' => wpsg_translate(__('Alle Produktgruppen (#1#)', 'wpsg'), wpsg_product::count($filterAll))), wpsg_productgroup::getProductgroupSelect($this->view['arFilter'])), @$this->view['arFilter']['productgroup_ids']); ?>
                         <?php } ?>
-						
+
+                        <?php if ($this->hasMod('wpsg_mod_produktartikel')) { ?>
+                        <?php
+                        $temp = $this->callMod('wpsg_mod_produktartikel', 'getProductcategorySelect', array($this->view['arFilter']));
+                        $arr = array();
+                        foreach ($temp as $vv) $arr[$vv['term_id']] = $vv['label'];
+                        echo wpsg_drawForm_Select('filter[productcategory_ids]', __('Produktkategorie', 'wpsg'),
+                        		wpsg_array_merge(array('-1' => wpsg_translate(__('Alle Produktkategorien (#1#)', 'wpsg'), wpsg_product::count($filterAll))),
+                        		$arr), @$this->view['arFilter']['productcategory_ids']); ?>
+                        <?php } ?>
+
                         <?php if (wpsg_istrue($this->view['submit'])) { ?>
                         <input type="hidden" name="submit-button" value="1" />
                         <?php } ?>
-                        
+
 						<?php echo wpsg_drawForm_SubmitButton(__('Produkte suchen')); ?><br />
-						
-					</form>				
+
+					</form>
 				</div>
-			</div>		
+			</div>
 		</div>
 	</nav>
@@ -63,7 +76,10 @@
         <?php if (wpsg_isSizedArray($arProductgroupSelect)) { ?>
             <div class="pagination_wrap wpsg_productgroup_link_wrap">
-                
-                <?php $filterAll = $this->view['arFilter']; unset($filterAll['productgroup_ids']); ?>
-                
+
+                <?php $filterAll = $this->view['arFilter'];
+                  	unset($filterAll['productgroup_ids']);
+                   	unset($filterAll['productcategory_ids']);
+                ?>
+
                 <ul class="pagination">
                     <li class="<?php echo ((wpsg_getStr($this->view['arFilter']['productgroup_ids']) == '-1' || !isset($this->view['arFilter']['productgroup_ids']))?'active':''); ?>"><a href="#" onclick="jQuery('#filterproductgroup_ids').val('-1'); jQuery('#filter_form').submit(); return false;"><?php echo wpsg_translate(__('Alle (#1#)', 'wpsg'), wpsg_product::count($filterAll)); ?></a></li>
@@ -77,4 +93,26 @@
         <?php } ?>
     <?php } ?>
+
+    <?php if ($this->hasMod('wpsg_mod_produktartikel')) { $arProductcategorySelect = $this->callMod('wpsg_mod_produktartikel', 'getProductcategorySelect', array($this->view['arFilter'])); ?>
+        <?php if (wpsg_isSizedArray($arProductcategorySelect)) { ?>
+            <div class="pagination_wrap wpsg_productgroup_link_wrap">
+
+                <?php $filterAll = $this->view['arFilter'];
+                	unset($filterAll['productgroup_ids']);
+                	unset($filterAll['productcategory_ids']);
+                ?>
+
+                <ul class="pagination">
+                    <li class="<?php echo ((wpsg_getStr($this->view['arFilter']['productcategory_ids']) == '-1' || !isset($this->view['arFilter']['productcategory_ids']))?'active':''); ?>"><a href="#" onclick="jQuery('#filterproductcategory_ids').val('-1'); jQuery('#filter_form').submit(); return false;"><?php echo wpsg_translate(__('Alle (#1#)', 'wpsg'), wpsg_product::count($filterAll)); ?></a></li>
+                    <?php foreach ($arProductcategorySelect as $pk_id => $pk) { ?>
+                    <li class="<?php echo ((wpsg_getInt($this->view['arFilter']['productcategory_ids'], -2) == $pk['term_id'])?'active':''); ?>"><a href="#" onclick="jQuery('#filterproductcategory_ids').val('<?php echo $pk['term_id']; ?>'); jQuery('#wpsg_seite').val('1'); jQuery('#filter_form').submit(); return false;"><?php echo $pk['label']; ?></a></li>
+                    <?php } ?>
+                </ul>
+
+            </div>
+            <div class="wpsg_clear"></div>
+        <?php } ?>
+    <?php } ?>
+
 
 	<?php if ($this->view['pages'] > 1) { ?>
@@ -94,7 +132,7 @@
 	<?php } ?>
 
-	<?php echo $this->writeBackendMessage(); ?> 
-			
-	<div class="content">	
+	<?php echo $this->writeBackendMessage(); ?>
+
+	<div class="content">
 		<?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
             <table class="table table-bordered table-hover table-striped wpsg-table-order">
@@ -129,5 +167,5 @@
                                 //$img = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($d['id'], 40, 40, 'c'));
                                 $img = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($d['id']));
-                                
+
                                 if ($img !== false)
                                 {
@@ -143,6 +181,6 @@
                         <?php } ?>
                         <td class="post-title column-title">
-                            <strong>                                
-                                <?php if ($this->isMultiLingual()) { ?>                                    
+                            <strong>
+                                <?php if ($this->isMultiLingual()) { ?>
                                 <?php foreach ($this->getStoreLanguages() as $l) { ?>
                                     <?php if ($l['locale'] != $this->getDefaultLanguageLocale()) { ?>
@@ -156,5 +194,5 @@
                             </strong>
                             <div class="row-actions">
-                                <span class="edit"><a title="<?php echo __("Dieses Produkt bearbeiten", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&amp;action=edit&amp;edit_id=<?php echo $d['id']; ?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>                                
+                                <span class="edit"><a title="<?php echo __("Dieses Produkt bearbeiten", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&amp;action=edit&amp;edit_id=<?php echo $d['id']; ?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>
                                 |
                                 <span class="del"><a onclick="if (!confirm('<?php echo __("Sind Sie sicher, dass Sie das Produkt lÃ¶schen wollen?", "wpsg"); ?>')) return false;" title="<?php echo __("Dieses Produkt lÃ¶schen", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&amp;action=del&amp;edit_id=<?php echo $d['id']; ?>&amp;noheader=1"><?php echo __("LÃ¶schen", "wpsg"); ?></a></span>
@@ -180,9 +218,9 @@
                             <div style="line-height:inherit; margin-bottom:0.2em;">
                             	<?php if ($d['stock'] == '0' ) {?>
-	                            	<div class="wpsg_productview_backend-sold-out"><?php echo __('Ausverkauft', 'wpsg');?></div>		
+	                            	<div class="wpsg_productview_backend-sold-out"><?php echo __('Ausverkauft', 'wpsg');?></div>
                            		<?php } else {  ?>
                            			<div class="wpsg_productview_backend-available"><?php echo __('VorrÃ€tig', 'wpsg');?></div><div>(<?php echo $d['stock']; ?>)</div>
                            		<?php }?>
-                            </div>                            
+                            </div>
                             <?php if ($this->hasMod('wpsg_mod_productvariants')) $arVarianten = $this->callMod('wpsg_mod_productvariants', 'getVariants', array($d['id'], true, true, true)); if (wpsg_isSizedArray($arVarianten)) { ?>
                             <div style="line-height:inherit; padding:2px 0px 0px;">
@@ -228,7 +266,7 @@
 
 		<?php } ?>
-		
+
 	</div>
-	
+
 </div>
 
@@ -265,29 +303,29 @@
 		jQuery('#wpsg_mod_productvariations_dialog button').prop('disabled', true);
 		jQuery('#wpsg_mod_productvariations_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
-		
+
 		//	wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
 		jQuery('#wpsg_mod_productvariations_dialog').modal();
-		
+
 		jQuery.ajax( {
 			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_stock&edit_id=<?php echo $d['id']; ?>&noheader=1&wpsg_cmd=getVariInfo',
-			data: {  
+			data: {
 				'subaction': 'admin_show',
 				'product_id': product_id
 			},
-			success: function(data) { 
-				
+			success: function(data) {
+
 				jQuery('.wpsg_mod_productvariants_variants').show();
 				jQuery('.wpsg_mod_productvariants_variants_vari').hide();
-				
+
 				jQuery('#wpsg_mod_productvariations_dialog .modal-body').html(data);
-				jQuery('#wpsg_mod_productvariations_dialog button').prop('disabled', false); 
+				jQuery('#wpsg_mod_productvariations_dialog button').prop('disabled', false);
 
 			}
-    	} ); 
-		 
+    	} );
+
 		return false;
-		
+
 	} // function wpsg_mod_productvariations_show()
-    
+
 	function goPage(page)
 	{
Index: /views/warenkorb/basket.phtml
===================================================================
--- /views/warenkorb/basket.phtml	(revision 6337)
+++ /views/warenkorb/basket.phtml	(revision 6338)
@@ -4,5 +4,5 @@
 	 * Template fÃŒr den Warenkorb
 	 */
- 
+
 	//wpsg_debug($this->view['basket']);
 	//wpsg_debug($_SESSION);
@@ -10,15 +10,15 @@
 
 	//wpsg_debug(__('Deutschland', 'wpsg'));
- 
+
 ?>
 <div class="wpsg wpsg_basket <?php echo ((isset($_REQUEST['wpsg_basket_ajax']))?'wpsg_basket_ajax':''); ?>">
-	
+
 	<?php if ($this->hasMod('wpsg_mod_onepagecheckout') && ($this->get_option('wpsg_mod_onepagecheckout_basket') == 1)) { ?>
 	<?php } else {?>
 	<?php echo $this->writeFrontendMessage(); ?>
 	<?php } ?>
-	
+
 	<?php $this->callMods('basket_top'); ?>
-	
+
 	<?php if (sizeof($this->view['basket']['produkte']) > 0) { ?>
 
@@ -31,26 +31,26 @@
 	<form id="wpsg_basket_form" name="wpsg_basket_form"  method="post" action="<?php echo $this->getURL(wpsg_ShopController::URL_CHECKOUT); ?>">
 	<?php } ?>
-	
+
 		<h2><?php echo __('Bestellte Produkte', 'wpsg'); ?></h2>
-		
+
 		<div class="wpsg_spacer"></div>
-		
+
 		<div class="basket_product_wrap">
-		
+
 			<?php $i = 0; foreach ($this->view['basket']['produkte'] as $k => $product_data) { $i ++; ?>
 
 			<div class="basket_product_row">
-			
+
 				<?php $this->view['$bPicture'] = false; ?>
 
 				<?php if ($this->get_option('wpsg_mod_produktbilder_basketimage') == '1' && $this->hasMod('wpsg_mod_produktbilder')) {
-					
+
 					if (wpsg_isSizedString($product_data['varianten_image'])) $arImages = array($product_data['varianten_image']);
 					else $arImages = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->getProduktID($product_data['id'])));
-					
+
 				?>
 				<div class="productimage">
 					<?php if (wpsg_isSizedString($arImages[0]['guid'])) { ?>
-					
+
 					<?php
 					if (isset($product_data['product_key'])) {
@@ -76,5 +76,5 @@
 
 				<div class="product_content">
-					
+
 					<div class="product_name">
 						<?php if ($this->getProduktLink($product_data)) { ?>
@@ -83,15 +83,16 @@
 						<?php echo wpsg_hspc((($product_data['detailname'] != '')?$product_data['detailname']:$product_data['name'])); ?>
 						<?php } ?>
-						
+
 						<?php if (wpsg_isSizedString($product_data['shortdesc'])) { ?>
 						<div class="product_shortdesc"><?php echo $product_data['shortdesc']; ?></div>
 						<?php } ?>
-						
+
 						<a class="wpsg_basket_removelink" href="<?php echo $this->getRemoveLinkURL($product_data['product_index']); ?>" title="<?php echo __('Produkt aus dem Warenkorb entfernen', 'wpsg'); ?>" onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass sie das Produkt aus dem Warenkorb entfernen mÃ¶chten?', 'wpsg'); ?>');">
-							<img src="<?php echo WPSG_URL; ?>views/gfx/bin_x.png" alt="<?php echo __('LÃ¶schen', 'wpsg'); ?>" />
+							<!-- <img src="<?php echo WPSG_URL; ?>views/gfx/bin_x.png" alt="<?php echo __('LÃ¶schen', 'wpsg'); ?>" /> -->
+							<span class="glyphicon glyphicon-trash"></span>
 						</a>
-						
-					</div>
-					
+
+					</div>
+
 					<div class="product_action">
 						<div class="title">
@@ -99,7 +100,6 @@
 						</div>
 						<div class="amount">
-							
+
 							<input class="wpsg_form_submit_return" type="text" name="wpsg[menge][<?php echo $product_data['product_index']; ?>]" <?php echo ((wpsg_isTrue($product_data['oneOnly']) || wpsg_isSizedInt($product_data['basket_multiple'], 4))?'readonly="readonly"':''); ?> value="<?php echo wpsg_hspc($product_data['menge']); ?>" size="3" />
-							
 						</div>
 					</div>
@@ -120,8 +120,8 @@
 						</div>
 					</div>
-					
+
 					<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
 					<div class="product_info">
-						<div 
+						<div
 						<?php if ($this->view['$bPicture'] == true) { ?>class="titlep"><?php } else { ?>class="title"><?php } ?>
 							<?php echo __("MwSt.", "wpsg"); ?>
@@ -133,5 +133,5 @@
 							<?php echo __('&nbsp;'); ?>
 						</div>
-						
+
 					</div>
 					<?php } ?>
@@ -139,17 +139,17 @@
 					<?php $strBasketRow = ''; ob_start(); $this->callMods('basket_row', array(&$product_data, $i)); $strBasketRow = ob_get_contents(); ob_end_clean(); ?>
 					<?php echo $strBasketRow; ?>
-					
-				</div>
-				
+
+				</div>
+
 			</div>
-			
+
 			<?php }   // foreach products ?>
-			
+
 		</div>
-		
+
 		<div class="basket_sum_wrap">
-		
+
 			<?php $this->callMods('basket_row_afterproducts', array(&$p, $i)); ?>
-			
+
 			<?php $bLine = false; ?>
 			<?php if (isset($this->view['basket']['gs'])) { $bLine = true; ?>
@@ -159,6 +159,7 @@
 					</div>
 					<div class="wpsg_basket_removelink">
-						<a href="<?php echo str_replace('&', '&amp;', $this->getRemoveLinkURL('gs')); ?>" title="<?php echo __('Gutschein aus dem Warenkorb entfernen', 'wpsg'); ?>" onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass sie den Gutschein aus dem Warenkorb entfernen mÃ¶chten?', 'wpsg'); ?>');">
-							<img src="<?php echo WPSG_URL; ?>views/gfx/bin_x.png" alt="<?php echo __('LÃ¶schen', 'wpsg'); ?>" />
+						<a class="wpsg_basket_removelink" href="<?php echo str_replace('&', '&amp;', $this->getRemoveLinkURL('gs')); ?>" title="<?php echo __('Gutschein aus dem Warenkorb entfernen', 'wpsg'); ?>" onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass sie den Gutschein aus dem Warenkorb entfernen mÃ¶chten?', 'wpsg'); ?>');">
+							<!-- <img src="<?php echo WPSG_URL; ?>views/gfx/bin_x.png" alt="<?php echo __('LÃ¶schen', 'wpsg'); ?>" /> -->
+							<span class="glyphicon glyphicon-trash"></span>
 						</a>
 					</div>
@@ -180,5 +181,5 @@
 			</div>
 			<?php } ?>
-		
+
 			<div class="basket_sum_row">
 				<?php if (isset($this->view['basket']['sum']['preis_rabatt']) && wpsg_tf($this->view['basket']['sum']['preis_rabatt']) > 0) { ?>
@@ -207,5 +208,5 @@
 					<?php } else { ?>
 						<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
-						<?php echo wpsg_translate(__('Summe (zzgl. #1#, zzgl. MwSt.)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>:				
+						<?php echo wpsg_translate(__('Summe (zzgl. #1#, zzgl. MwSt.)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>:
 						<?php } else { ?>
 						<?php echo wpsg_translate(__('Summe (zzgl. #1#, inkl. MwSt.)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>:
@@ -217,5 +218,5 @@
 				</div>
 			</div>
-			
+
 			<div class="basket_sum_row">
 				<div class="title">
@@ -249,13 +250,13 @@
 						if (isset($this->view['basket']['shipping']['tax_rata']) && $this->view['basket']['shipping']['tax_rata'] === true)
 						{
-						
+
 							echo __('anteilig', 'wpsg');
-						
+
 						}
 						else if (array_key_exists($this->view['basket']['checkout']['shipping'], $this->arShipping))
 						{
-						
+
 							echo wpsg_ff($this->arShipping[$this->view['basket']['checkout']['shipping']]['mwst_value'], '%');
-						
+
 						}
 				 	}
@@ -266,5 +267,5 @@
 				</div>
 			</div>
-			
+
 			<?php /* Zeile fÃŒr Zahlungsart BEGIN */ ?>
 			<?php if (!$this->hasMod('wpsg_mod_crefopay')) { ?>
@@ -287,18 +288,18 @@
 					<div class="value">
 						<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') {
-					 
+
 							if (isset($this->view['basket']['payment']['tax_rata']) && $this->view['basket']['payment']['tax_rata'] === true)
 							{
-								
+
 								echo __('anteilig', 'wpsg');
-								
+
 							}
 							else if (array_key_exists(wpsg_getStr($this->view['basket']['checkout']['payment']), $this->arPayment))
 							{
-								
+
 								echo wpsg_ff($this->arPayment[$this->view['basket']['checkout']['payment']]['mwst_value'], '%');
-								
+
 							}
-						
+
 						} ?>
 					</div>
@@ -360,27 +361,27 @@
 				<div class="wpsg_spacer"></div>
 			<?php } ?>
-			
+
 			<?php $this->callMods('basket_row_end', array(&$this->view)); ?>
-			
+
 			<br />
 			<div class="wpsg_spacer"></div>
 
 			<?php $this->callMods('basket_inner_prebutton', array(&$this->view)); ?>
-			
+
 		</div>
-		
+
 		<input type="hidden" name="wpsg_basket_submit" value="1" />
-		
+
 		<input type="submit" class="wpsg_button wpsg_refreshbutton" value="<?php echo __('aktualisieren', 'wpsg'); ?>" name="wpsg_basket_refresh" />
 		<?php if ($this->hasMod('wpsg_mod_onepagecheckout') && ($this->get_option('wpsg_mod_onepagecheckout_basket') == 1)) { ?>
 		<?php } else { ?>
 			<input type="submit" class="wpsg_button wpsg_checkoutbutton" value="<?php echo __('zur Kasse', 'wpsg'); ?>" name="wpsg_checkout" />
-			
+
 			<br /><br />
-			
-			<a href="<?php echo WPSG_URL_WP;?>" class="wpsg_basket_weiter_shoppen"><?php echo __('weiter shoppen', 'wpsg'); ?></a>
+
+			<a href="<?php echo WPSG_URL_WP;?>" class="wpsg_basket_weiter_shoppen2"><?php echo __('weiter shoppen', 'wpsg'); ?></a>
 		<?php } ?>
 		<div class="wpsg_clear"></div>
-		
+
 		<?php $this->ClearSessionErrors(); ?>
 
@@ -388,14 +389,12 @@
 		</form>
 	<?php } ?>
-	
+
 	<br />
 	<?php $this->callMods('basket_after', array(&$this->view)); ?>
-	
-	<br />
 
 	<?php } else { ?>
 	<p><?php echo __('Keine Produkte im Warenkorb.', 'wpsg'); ?></p>
 	<?php } ?>
-	
+
 </div>
 
@@ -412,20 +411,20 @@
 
 				jQuery('.wpsg_refreshbutton').click(); return false;
-				
+
 			}
-			  
+
 		} );
-		
+
 		jQuery('.wpsg_form_submit').bind('change', function() {
-		  
+
 			jQuery('.wpsg_refreshbutton').click();
-		
+
 		} );
 
 		jQuery('#set_land').bind('change', function() {
-			  
+
 			land = jQuery('#set_land').val();
 			jQuery('#wpsg_land').val(land);
-		
+
 		} );
 
@@ -433,16 +432,16 @@
 		land = jQuery('#set_land').val();
 		jQuery('#wpsg_land').val(land);
-		
+
 	} );
 
-	<?php if (isset($_REQUEST['wpsg_basket_ajax'])) { ?> 
+	<?php if (isset($_REQUEST['wpsg_basket_ajax'])) { ?>
 
 		jQuery(document).ready(function() {
-			
-			jQuery('.wpshopgermany_widget').load('<?php echo $this->getURL(wpsg_ShopController::URL_WIDGET_AJAX); ?>');		
-			
+
+			jQuery('.wpshopgermany_widget').load('<?php echo $this->getURL(wpsg_ShopController::URL_WIDGET_AJAX); ?>');
+
 		} );
 
 	<?php } ?>
-	
+
 /* ]]> */</script>
