Index: /changelog
===================================================================
--- /changelog	(revision 7892)
+++ /changelog	(revision 7893)
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7892)
+++ /controller/wpsg_ShopController.class.php	(revision 7893)
@@ -2119,5 +2119,5 @@
 		 */
 		public function loadProduktArray($produkt_id, $override = array(), $loadDisabled = false) {
-		    
+
 		    //if (array_key_exists($produkt_id, $this->productCache)) return $this->productCache[$produkt_id];
 
@@ -2258,5 +2258,5 @@
 
             $this->productCache[$produkt_id] = $produkt;
-            
+
 			return $produkt;
 
@@ -2498,30 +2498,27 @@
 		 * Bei Varianten: vp_8/0_0
 		 */
-		public function getProduktID($produkt_key)
-		{
+		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);
-			}
-			else if (preg_match('/abo_\d+_\d+/', $produkt_key))
-			{
+
+			} else if (preg_match('/abo_\d+_\d+/', $produkt_key)) {
 
 				$arData = explode('_', $produkt_key);
 				
 				$oOrderProduct = wpsg_order_product::getInstance(intval($arData[2]));
-				
+
 				return $oOrderProduct->getProductId();
 
-			}
-			else
-			{
+			} else {
 
 				throw new \wpsg\Exception(_('Produkt ID konnte nicht gebildet werden: ').$produkt_key, \wpsg\Exception::TYP_UNEXPECTED);
+
 				return 0;
 
Index: /lib/filter_functions.inc.php
===================================================================
--- /lib/filter_functions.inc.php	(revision 7892)
+++ /lib/filter_functions.inc.php	(revision 7893)
@@ -804,9 +804,7 @@
     
         // Module aus Lizenz nachinstallieren
-        foreach ($wpsg_update_data['modulinfo'] as $modul_key => $modul_info)
-        {
-    
-            if ($modul_info['active'] === true || $modul_info['demo_active'] === true)
-            {
+        foreach ($wpsg_update_data['modulinfo'] as $modul_key => $modul_info) {
+    
+            if ($modul_info['active'] === true || $modul_info['demo_active'] === true) {
     
                 $AC->installModul($modul_key);
Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 7892)
+++ /lib/wpsg_basket.class.php	(revision 7893)
@@ -287,6 +287,5 @@
 		 * Initiiert den Warenkorb aus der Session heraus
 		 */
-		public function initFromSession($rebuild = false)
-		{
+		public function initFromSession($rebuild = false) {
 			
 			if (!isset($_SESSION['wpsg']['basket'])) return;
@@ -295,9 +294,8 @@
 			$this->arProdukte = array();
 			
-			foreach ((array)$_SESSION['wpsg']['basket'] as $produkt_key => $b)
-			{
+			foreach ((array)$_SESSION['wpsg']['basket'] as $produkt_key => $b) {
 				
 				$this->arProdukte[$produkt_key] = $b;
-				
+
 			}
 
@@ -387,25 +385,25 @@
 			$this->oCalculation = null;
 			$this->arCheckout = array(
-				'firma' => $kunde['firma'],
-				'title' => $kunde['title'],
-				'vname' => $kunde['vname'],
-				'name' => $kunde['name'],
-				'email' => $kunde['email'],
-				'geb' => date('d.m.Y', strtotime($kunde['geb'])),
-				'email2' => $kunde['email'],
-				'tel' => $kunde['tel'],
-				'strasse' => $kunde['strasse'],
-				'nr' => $kunde['nr'],
-				'fax' => $kunde['fax'],
-				'plz' => $kunde['plz'],
-				'ort' => $kunde['ort'],
-				'land' => $kunde['land'],
-				'ustidnr' => $kunde['ustidnr'],
-				'custom' => $kunde['custom'],
+				'firma' => wpsg_getStr($kunde['firma']),
+				'title' => wpsg_getStr($kunde['title']),
+				'vname' => wpsg_getStr($kunde['vname']),
+				'name' => wpsg_getStr($kunde['name']),
+				'email' => wpsg_getStr($kunde['email']),
+				'geb' => date('d.m.Y', strtotime(wpsg_getStr($kunde['geb']))),
+				'email2' => wpsg_getStr($kunde['email']),
+				'tel' => wpsg_getStr($kunde['tel']),
+				'strasse' => wpsg_getStr($kunde['strasse']),
+				'nr' => wpsg_getStr($kunde['nr']),
+				'fax' => wpsg_getStr($kunde['fax']),
+				'plz' => wpsg_getStr($kunde['plz']),
+				'ort' => wpsg_getStr($kunde['ort']),
+				'land' => wpsg_getStr($kunde['land']),
+				'ustidnr' => wpsg_getStr($kunde['ustidnr']),
+				'custom' => wpsg_getStr($kunde['custom']),
 				'shipping' => $order['type_shipping'],
 				'payment' => $order['type_payment'],
 				'comment' => $order['comment'],
 				'onr' => $order['onr'],
-				'knr' => $kunde['knr'],
+				'knr' => wpsg_getStr($kunde['knr']),
 				'datum' => strtotime($order['cdate'])
 			);
@@ -1334,6 +1332,5 @@
 				$country = $this->shop->getDefaultCountry();
 				
-				if (is_numeric($produkt_id))
-				{
+				if (is_numeric($produkt_id)) {
 					
 					// Preis wird berechnet daher entfernen
@@ -1368,6 +1365,5 @@
 				$this->checkMwSt($b['mwst_key'], $country, $arReturn);
 
-				if ($noMwSt)
-				{
+				if ($noMwSt) {
 					
 					// Damit erreiche ich, dass 0% angezeigt wird, wenn keine MwSt. berechnet wird
@@ -1377,7 +1373,5 @@
 					$price_product_brutto = $b['preis_netto'];
 					
-				}
-				else
-				{
+				} else {
 					
 					$price_product_netto = $b['preis_netto'];
@@ -1385,5 +1379,5 @@
 					
 				}
-				
+
 				// Hier wird entschieden ob der gerundete oder der genaue Wert zum Gesamtpreis hinzuaddiert wird
 				if ($this->shop->addRoundedValues === true)
@@ -1401,5 +1395,5 @@
 					
 				}
-				
+
 				$price_sum_netto = $b['preis_netto'] * $b['menge'];
 				$price_sum_brutto = $b['preis_brutto'] * $b['menge'];
@@ -1410,5 +1404,5 @@
 				$arProductPrice[WPSG_NETTO][$b['mwst_key'].'_'.$country->id][] = $price_sum_netto;
 				$arProductPrice[WPSG_BRUTTO][$b['mwst_key'].'_'.$country->id][] = $price_sum_brutto;
-				
+
 				$b['product_index'] = $product_index;
 				$arReturn['produkte'][$product_index] = $b;
@@ -1417,13 +1411,10 @@
 
 			// Die Basis der Preisberechnung, wenn Brutto, dann wird Netto berechnet
-			if ($this->shop->getFrontendTaxview() == WPSG_NETTO)
-			{
+			if ($this->shop->getFrontendTaxview() == WPSG_NETTO) {
 				
 				$base = WPSG_NETTO;
 				$calc = WPSG_BRUTTO;
 				
-			}
-			else
-			{
+			} else {
 				
 				$base = WPSG_BRUTTO;
@@ -1433,6 +1424,5 @@
 			
 			// Jetzt die jeweilige Steuer berechnen, damit die Anzeige stimmt
-			foreach ($arProductPrice[$base] as $tax_key_lang => $tax)
-			{
+			foreach ($arProductPrice[$base] as $tax_key_lang => $tax) {
 				
 				$arTaxKey = explode('_', $tax_key_lang);
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 7892)
+++ /model/wpsg_product.class.php	(revision 7893)
@@ -390,5 +390,8 @@
 				
 			}
-			
+
+			// Abo VerlÃ€ngerungen
+			$this->shop->callMod('wpsg_mod_abo', 'product_getPrice', [&$this, &$price_netto, &$price_brutto, $product_key, $amount, $weight]);
+
 			if ($scalePrice) {
 				
@@ -397,5 +400,5 @@
 				
 			}
-	 
+
 			// Varianten 
 			$this->shop->callMod('wpsg_mod_productvariants', 'product_getPrice', [&$this, &$price_netto, &$price_brutto, $product_key, $amount, $weight]);
@@ -404,6 +407,5 @@
 			$this->shop->callMod('wpsg_mod_discount', 'product_getPrice', [&$this, &$price_netto, &$price_brutto, $product_key, $amount, $weight]);
 			 
-			if ($taxView === false)
-			{
+			if ($taxView === false) {
 				
 				if (is_admin()) $taxView = $this->shop->getBackendTaxview();
@@ -412,12 +414,9 @@
 			}
 			
-			if ($taxView === WPSG_BRUTTO)
-			{
+			if ($taxView === WPSG_BRUTTO) {
 				
 				$price = $price_brutto;
 				
-			}
-			else
-			{
+			} else {
 				
 				$price = $price_netto;
Index: /mods/mod_abo/wpsg_abo.php
===================================================================
--- /mods/mod_abo/wpsg_abo.php	(revision 7892)
+++ /mods/mod_abo/wpsg_abo.php	(revision 7893)
@@ -104,24 +104,37 @@
             $order_product_id = intval($this->__get('order_product_id'));
             
-            if ($order_product_id <= 0) return false;
-            
+            if ($order_product_id <= 0) {
+
+                $product_key = intval($this->__get('product_key'));
+                $order_id = intval($this->__get('order_id'));
+
+                if ($product_key > 0 && $order_id > 0) {
+
+                    $order_product_id = intval($this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `productkey` = '".wpsg_q($product_key)."' AND `o_id` = '".wpsg_q($order_id)."' "));
+
+                    if ($order_product_id <= 0) return false;
+
+                }
+
+            }
+
             try {
-            
-                return wpsg_order_product::getInstance(intval($this->__get('order_product_id')));
-                
+
+                return wpsg_order_product::getInstance($order_product_id);
+
             } catch (\Exception $e) {
-                
+
                 return false;
-                
-            }
-            
-        }
-        
+
+            }
+
+        }
+
         public function getNr() {
-            
+
             return $this->getOrder()->getNr();
-            
-        }
-         
+
+        }
+
         public static function getFromOrderAndOrderProduct($order_id, $order_product_id) {
 
@@ -130,7 +143,31 @@
             );
 
-            if ($abo_id <= 0) throw new \wpsg\Exception(wpsg_translate(
-                __('Kein Abo zu dieser Bestellung (ID:#1#) und BestellProdukt (ID:#2#) gefunden.', 'wpsg'), $order_id, $order_product_id
-            ));
+            if ($abo_id <= 0) {
+
+                // Fallback fÃŒr alte Abo's / VerlÃ€ngerungen
+
+                $oOrderProduct = wpsg_order_product::getInstance($order_product_id);
+
+                if (preg_match('/^abo_\d+_\d+$/', $oOrderProduct->getProductKey())) {
+
+                	$abo_id = intval(explode('_', $oOrderProduct->getProductKey())[1]);
+
+                } else {
+
+	                $abo_id = intval(
+	                    wpsg_ShopController::getShop()->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_id)."' AND `product_key` = '".wpsg_q($oOrderProduct->getProductKey())."' ")
+	                );
+
+                }
+
+                if ($abo_id <= 0) {
+
+                    throw new \wpsg\Exception(wpsg_translate(
+                    __('Kein Abo zu dieser Bestellung (ID:#1#) und BestellProdukt (ID:#2#) gefunden.', 'wpsg'), $order_id, $order_product_id
+                    ));
+
+                }
+
+            }
 
             return wpsg_abo::getInstance($abo_id);
Index: /mods/wpsg_mod_abo.class.php
===================================================================
--- /mods/wpsg_mod_abo.class.php	(revision 7892)
+++ /mods/wpsg_mod_abo.class.php	(revision 7893)
@@ -10,5 +10,5 @@
 		var $id = 1630;
 		var $hilfeURL = 'http://wpshopgermany.de/?p=3292';
-		var $version = "9.9.9";
+		var $version = "4.3.2.7892";
 
 		const CONFIG = '-1';
@@ -17,12 +17,12 @@
         const EXPIRE_MAIL = '1';
         const EXPIRE_AUTO = '2';
-         
+
         const CUSTOMER_AUTO_NOTHING = '0'; // Kunde kann im Frontend nicht auf die automatische VerlÃ€ngeurng eingreifen
         const CUSTOMER_AUTO_DIRECT = '1'; // Kunde kann die automatische VerlÃ€ngerung direkt stoppen
         const CUSTOMER_AUTO_MAIL = '2'; // Kunde kann die automatische VerlÃ€ngerung ÃŒber eine Mail an den Admin stoppen
-        
+
         const STATUS_ACTIVE = '0'; // Standard
         const STATUS_STOPPED = '1'; // Abo ist gestoppt, es erfolgt keine manuelle oder automatische VerlÃ€ngerung
-        
+
 		/**
 		 * Costructor
@@ -39,27 +39,30 @@
 
         public function init() {
-            
+
             // Option gab es frÃŒher nicht und wird hier auf den Default Wert korrigiert.
             if ($this->shop->get_option('wpsg_mod_abo_expiremode') === false) $this->shop->update_option('wpsg_mod_abo_expiremode', self::EXPIRE_MAIL);
-                        
+
             require_once WPSG_PATH_MOD.'/mod_abo/wpsg_abo.php';
-            
+
+			$role_object = get_role('administrator');
+			$role_object->add_cap('wpsg_abo');
+
         } // public function init()
-        
+
         public function admin_setcapabilities() {
-        
+
         	$this->render(WPSG_PATH_VIEW.'/mods/mod_abo/admin_setcapabilities.phtml');
-        
+
         } // public function admin_setcapabilities()
-         
+
 		public function install() {
 
 			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
-			
+
 			// Grundeinstellung Pro Seite
 			if ($this->shop->get_option('wpsg_mod_abo_perpage') === false || $this->shop->get_option('wpsg_mod_abo_perpage') == '') {
-			    
+
 				$this->shop->update_option('wpsg_mod_abo_perpage', '20');
-				
+
 			}
 
@@ -91,4 +94,5 @@
 				status int(1) DEFAULT '0' NOT NULL,
 				mail_admin_stop DATETIME NOT NULL COMMENT 'Wird auf 1 gesetzt, wenn der Admin das Abo stoppen soll',
+				product_key VARCHAR(255) NOT NULL COMMENT 'Deprecated, wird aber wegen AbwÃ€rtskompatibilitÃ€t noch gebraucht',
 				PRIMARY KEY  (id),
 	  			KEY order_id (order_id), 
@@ -121,26 +125,26 @@
             // Alle Abo-Produkte zu dieser Bestellung in der Tabelle WP_WPSG_ABO lÃ¶schen
             $this->db->Query("DELETE FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_id)."' ");
-            
+
         } // public function delOrder($order_id)
-         
+
 		/**
 		 * Ãbersicht ÃŒber die Kunden im Backend
 		 */
 		private function be_indexAction() {
-			
+
 			if (isset($_REQUEST['submit-button'])) wpsg_checkNounce('Abo', 'index', ['search' => '1']);
-		
+
 			$nPerPage = $this->shop->get_option('wpsg_mod_abo_perpage');
 			if ($nPerPage <= 0) $nPerPage = 10;
-			
+
 			$this->shop->view['hasFilter'] = false;
-			$this->shop->view['pages'] = 0; 
+			$this->shop->view['pages'] = 0;
 			$this->shop->view['arState'] = [];
 			$this->shop->view['arFilter'] = array(
                 'order' => 'cdate',
-                'ascdesc' => 'DESC', 
+                'ascdesc' => 'DESC',
                 'page' => '1'
 			);
-			  
+
 			if (isset($_REQUEST['filter']['s'])) $this->shop->view['arFilter']['s'] = sanitize_text_field($_REQUEST['filter']['s']);
             if (isset($_REQUEST['filter']['k_id'])) $this->shop->view['arFilter']['k_id'] = sanitize_text_field($_REQUEST['filter']['k_id']);
@@ -153,51 +157,51 @@
             $filter_state = $this->shop->view['arFilter'];
             unset($filter_state['state']);
-            
+
             $this->shop->view['arState'][0] = [
                 'label' => __('Alle', 'wpsg'),
                 'count' => wpsg_abo::count($filter_state)
             ];
-            
+
 			foreach (wpsg_abo::$arState as $state_key => $state_label) {
-			    
+
 			    $filter_state = $this->shop->view['arFilter'];
 			    $filter_state['state'] = $state_key;
 			    $count = wpsg_abo::count($filter_state);
-			    
+
 			    if ($count > 0) {
-			    
+
 			        $this->shop->view['arState'][$state_key] = [
                         'label' => $state_label,
                         'count' => wpsg_abo::count($filter_state)
                     ];
-			        
+
                 }
-			    
+
             }
-			
+
 			$this->shop->view['countAll'] = wpsg_abo::count($this->shop->view['arFilter']);
-			
+
 			if (wpsg_isSizedInt($_REQUEST['seite'])) $this->shop->view['arFilter']['page'] = $_REQUEST['seite'];
-			
+
 			$this->shop->view['pages'] = ceil($this->shop->view['countAll'] / $nPerPage);
 			if (!isset($this->shop->view['arFilter']['page']) || $this->shop->view['arFilter']['page'] <= 0 || $this->shop->view['arFilter']['page'] > $this->shop->view['pages']) $this->shop->view['arFilter']['page'] = 1;
-			
+
 			$this->shop->view['arFilter']['limit'] = array(($this->shop->view['arFilter']['page'] - 1) * $nPerPage, $nPerPage);
-			
+
 			// Filter speichern
 			$_SESSION['wpsg']['backend']['order']['arFilter'] = $this->shop->view['arFilter'];
-			
+
 			$this->shop->view['arData'] = wpsg_abo::find($this->shop->view['arFilter']);
-			
+
 			$this->shop->view['cdate_years'] = $this->db->fetchAssocField("SELECT DISTINCT DATE_FORMAT(`cdate`, '%Y') FROM `".WPSG_TBL_ORDER."` ORDER BY `cdate` ASC ");
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/index.phtml');
-			
+
 		} // private function be_indexAction()
-		
+
 		public function dispatch() {
-			
+
 		    if (wpsg_isSizedString($_REQUEST['action'], 'delete')) {
-		        
+
 		        $abo_id = intval($_REQUEST['abo_id']);
 
@@ -206,18 +210,18 @@
                 $this->shop->addBackendMessage(__('Abo erfolgreich gelÃ¶scht.', 'wpsg'));
                 $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Abo');
-                
+
             }
-		    
+
 			$this->be_indexAction();
-			
+
 		} // public function dispatch()
 
 		public function wpsg_add_pages($default_page)
 		{
-		
-			add_submenu_page('wpsg-Admin', __("Aboverwaltung", "wpsg"), __("Aboverwaltung", "wpsg"), 'wpsg_abo', 'wpsg-Abo', array($this, 'dispatch'));
-				
+
+			add_submenu_page($default_page, __("Aboverwaltung", "wpsg"), __("Aboverwaltung", "wpsg"), 'wpsg_abo', 'wpsg-Abo', array($this, 'dispatch'));
+
 		} // public function wpsg_add_pages()
-		
+
 		public function settings_edit()
 		{
@@ -236,5 +240,5 @@
 			$this->shop->update_option('wpsg_mod_abo_expiremode', $_REQUEST['wpsg_mod_abo_expiremode'], false, false, WPSG_SANITIZE_VALUES, [wpsg_mod_abo::EXPIRE_NONE, wpsg_mod_abo::EXPIRE_AUTO, wpsg_mod_abo::EXPIRE_MAIL]);
 			$this->shop->update_option('wpsg_mod_abo_premode', $_REQUEST['wpsg_mod_abo_premode'], false, false, WPSG_SANITIZE_VALUES, [wpsg_mod_abo::EXPIRE_NONE, wpsg_mod_abo::EXPIRE_AUTO, wpsg_mod_abo::EXPIRE_MAIL]);
-            
+
 			$this->shop->update_option('wpsg_mod_abo_autoexpire_payment', $_REQUEST['wpsg_mod_abo_autoexpire_payment'], false, false, WPSG_SANITIZE_VALUES, array_merge(['origin'], array_keys($this->shop->arPayment)));
 			$this->shop->update_option('wpsg_mod_abo_autoexpire_customermail', $_REQUEST['wpsg_mod_abo_autoexpire_customermail'], false, false, WPSG_SANITIZE_CHECKBOX);
@@ -242,6 +246,29 @@
 			$this->shop->update_option('wpsg_mod_abo_autoexpire_customer', $_REQUEST['wpsg_mod_abo_autoexpire_customer'], false, false, WPSG_SANITIZE_VALUES, [wpsg_mod_abo::CUSTOMER_AUTO_DIRECT, wpsg_mod_abo::CUSTOMER_AUTO_MAIL, wpsg_mod_abo::CUSTOMER_AUTO_NOTHING]);
 			$this->shop->update_option('wpsg_mod_abo_autoexpire_informationtime', wpsg_xss($_REQUEST['wpsg_mod_abo_autoexpire_informationtime']), false, false, WPSG_SANITIZE_TEXTFIELD);
-            
+
 		} // public function settings_save()
+
+		public function product_getPrice(&$oProduct, &$price_netto, &$price_brutto, $product_key, $amount, $weight) {
+
+			if (preg_match('/^abo_\d+\_\d+$/', $product_key)) {
+
+				$arKey = explode('_', $product_key);
+				$oOrderProduct = wpsg_order_product::getInstance(intval($arKey[2]));
+
+				if ($this->shop->getBackendTaxview() === WPSG_NETTO) {
+
+					$price_netto = $oOrderProduct->getProduct()->__get('wpsg_mod_abo_price');
+					$price_brutto = wpsg_calculatePreis($price_netto, WPSG_BRUTTO, $this->shop->getDefaultCountry()->getTax($oOrderProduct->getProduct()->mwst_key));
+
+				} else {
+
+					$price_brutto = $oOrderProduct->getProduct()->__get('wpsg_mod_abo_price');
+					$price_netto = wpsg_calculatePreis($price_brutto, WPSG_NETTO, $this->shop->getDefaultCountry()->getTax($oOrderProduct->getProduct()->mwst_key));
+
+				}
+
+			}
+
+		}
 
 		public function product_addedit_content(&$product_content, &$product_data) {
@@ -265,5 +292,5 @@
 
 			$this->shop->view['product'] = $product_data;
-			
+
 		    $oProduct = wpsg_product::getInstance($product_data['id']);
 
@@ -275,5 +302,5 @@
             $this->shop->view['product']['wpsg_mod_abo_autoexpire_informationtime'] = $oProduct->getMeta('wpsg_mod_abo_autoexpire_informationtime', false, '');
             $this->shop->view['product']['wpsg_mod_abo_autoexpire_customer'] = $oProduct->getMeta('wpsg_mod_abo_autoexpire_customer', false, wpsg_mod_abo::CONFIG);
-            
+
 			$product_content['wpsg_mod_abo'] = array(
 					'title' => __('Abo', 'wpsg'),
@@ -288,11 +315,11 @@
 
 			if (isset($_REQUEST['wpsg_mod_abo_activ']) && $_REQUEST['wpsg_mod_abo_activ'] == '1') {
-								
+
 				$product_data['wpsg_mod_abo_activ'] = '1';
-				
+
 				wpsg_checkRequest('wpsg_mod_abo_price', [WPSG_SANITIZE_FLOAT], __('Abo Produkt / Abo Preis', 'wpsg'), $product_data);
 				wpsg_checkRequest('wpsg_mod_abo_durration', [WPSG_SANITIZE_INT], __('Abo Produkt / Abo Dauer', 'wpsg'), $product_data);
 				wpsg_checkRequest('wpsg_mod_abo_url', [WPSG_SANITIZE_URL], __('Abo Produkt / URL Benachrichtigung', 'wpsg'), $product_data);
-				
+
 				if ($_REQUEST['wpsg_mod_abo_resell'] == '1') {
 
@@ -300,5 +327,5 @@
 
 						$this->shop->addBackendError(__('UngÃŒltige Anzahl von zulÃ€ssigen AbokÃ€ufen. Wurde auf unendlich gesetzt.', 'wpsg'));
-						
+
 						$product_data['wpsg_mod_abo_resell'] = '0';
 
@@ -319,12 +346,12 @@
 				$product_data['wpsg_mod_abo_activ'] = '0';
 
-			}			
+			}
 
 		} // public function produkt_save(&$produkt_id)
 
-        public function produkt_save(&$product_id) { 
-		    
+        public function produkt_save(&$product_id) {
+
 		    $oProduct = wpsg_product::getInstance($product_id);
-		    
+
 		    if (wpsg_checkInput($_REQUEST['wpsg_mod_abo_expiremode'], WPSG_SANITIZE_VALUES, [self::CONFIG, self::EXPIRE_AUTO, self::EXPIRE_MAIL]))
 		        $oProduct->setMeta('wpsg_mod_abo_expiremode', $_REQUEST['wpsg_mod_abo_expiremode']);
@@ -332,5 +359,5 @@
 		    if (wpsg_checkInput($_REQUEST['wpsg_mod_abo_premode'], WPSG_SANITIZE_VALUES, [self::CONFIG, self::EXPIRE_AUTO, self::EXPIRE_MAIL]))
 		    	$oProduct->setMeta('wpsg_mod_abo_premode', $_REQUEST['wpsg_mod_abo_premode']);
-		    
+
 		    if (wpsg_checkInput($_REQUEST['wpsg_mod_abo_autoexpire_payment'], WPSG_SANITIZE_VALUES, array_merge(['origin'], array_keys($this->shop->arPayment)))) $oProduct->setMeta('wpsg_mod_abo_autoexpire_payment', $_REQUEST['wpsg_mod_abo_autoexpire_payment']);
             if (wpsg_checkInput($_REQUEST['wpsg_mod_abo_autoexpire_customermail'], WPSG_SANITIZE_VALUES, [self::CONFIG, '0', '1'])) $oProduct->setMeta('wpsg_mod_abo_autoexpire_customermail', $_REQUEST['wpsg_mod_abo_autoexpire_customermail']);
@@ -340,32 +367,32 @@
 
         }
-        
+
 		public function setAboStatus($order_id, $status_id, $inform)
 		{
-		
+
 			$this->db->UpdateQuery(WPSG_TBL_ABO, array(
 					'status' => $status_id
 			), "`order_id` = '".wpsg_q($order_id)."'");
-			
+
 			$oOrder = wpsg_order::getInstance($order_id);
 			$this->shop->view['stornoDate'] = time();
-			
+
 			$this->shop->view['customer']['vname'] = $oOrder->getInvoiceFirstName();;
 			$this->shop->view['customer']['name'] = $oOrder->getInvoiceName();;
 			$this->shop->view['customer']['email'] = $oOrder->getCustomer()->getEMail();
-			
+
 			$arOrderProducts = $this->getAboProductsFromOrder($order_id);
-			
+
 			foreach ($arOrderProducts as $oOrderProduct)
 			{
-				
+
 				$abo_status = $this->getAboProductStatus($order_id, $oOrderProduct->getProductId());
-				
+
 				if ($inform) $this->sendCustomerMailResign($abo_status);
-				
-			}
-			
+
+			}
+
 		}	// public function setAboStatus($order_id, $status_id, $inform)
-		
+
 		public function setOrderStatus($order_id, $status_id, $inform) {
 
@@ -383,12 +410,12 @@
 					    // Kauf einer VerlÃ€ngerung
                         // Hier ist der Productkey abo_{original_order_id}_{original_order_product_id}
-					    
+
 						// BestellID der OriginalBestellung
 						$order_base_id = $this->getOrderIDFromKey($product['productkey']);
 						$order_product_id = $this->getOrderProductIDFromKey($product['productkey']);
-						 
+
 						// Eine Abo VerlÃ€ngerung wurde gekauft
 						$abo_entry = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_base_id)."' AND `order_product_id` = '".wpsg_q($order_product_id)."'");
- 						
+
 						if ($abo_entry['id'] <= 0) throw new \wpsg\Exception(__('Es wurde eine Bestellung auf Zahlung aktzeptiert gesetzt, die eine Abo VerlÃ€ngerung drin hat zu der kein Eintrag existiert', 'wpsg'));
 						if ($product_data['wpsg_mod_abo_resell'] != 0 && $abo_entry['rebuy'] + $product['menge'] > $product_data['wpsg_mod_abo_resell']) throw new \wpsg\Exception('Es wurde eine Bestellung auf Zahlung aktzeptiert gesetzt, das Abo konnte aber nicht verlÃ€ngert werden da es die gÃŒltige Anzahl im Produkt ÃŒberschreibt', __('wpsg'));
@@ -412,9 +439,9 @@
                             'inform_autorenew' => '0'
 						), "`id` = '".wpsg_q($abo_entry['id'])."'");
-						
+
 						$url = $this->getNotifyURL($product_data['id']);
-						
+
 						if (wpsg_isSizedString($url)) {
-							
+
 							$this->shop->notifyURL($url, $product['productkey'], 1, $order_id, 3, array(
 								'typ' => 'abo_rebuy',
@@ -423,5 +450,5 @@
 								'abo_expiration' => $abo_expiration,
 							));
-							
+
 						}
 
@@ -436,5 +463,5 @@
 
 						if ($product_data['wpsg_mod_abo_activ'] == '1') {
-						    
+
 							// Existiert ein Eintrag in der Abotabelle schon, so wird dieser gelÃ¶scht
 							$abo_id = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_id)."' AND `order_product_id` = '".wpsg_q($product['order_product_id'])."'");
@@ -456,7 +483,7 @@
 
 							$url = $this->getNotifyURL($product_data['id']);
-							
+
 							if (wpsg_isSizedString($url)) {
-								
+
 								$this->shop->notifyURL($url, $product['productkey'], 1, $order_id, 3, array(
 									'typ' => 'abo_firstbuy',
@@ -464,5 +491,5 @@
 									'abo_expiration' => $abo_expiration,
 								));
-								
+
 							}
 
@@ -482,26 +509,26 @@
 			}
 
-		} 
-		
-		public function calculation_saveOrder(&$oCalculation, $arCalculation, &$db_data, $finish_order) { 
-		
+		}
+
+		public function calculation_saveOrder(&$oCalculation, $arCalculation, &$db_data, $finish_order) {
+
 			if (!$finish_order) return;
-			
+
 			foreach ($_SESSION['wpsg']['basket'] as $p) {
-								
+
 				if (substr($p['id'], 0, 3) == 'abo')
 				{
-					
+
 					// Ein Abo Produkt wurde gekauft
 					$arAbo = explode('_', $p['id']);
-					
+
 					$db_data['wpsg_mod_abo_origin_order'] = wpsg_q($arAbo[1]);
-					
+
 				}
-				
-			}
-			
+
+			}
+
 		}
-		
+
 		public function cron() {
 
@@ -574,7 +601,7 @@
 				// URL Benachrichtigung
 				$url = $this->getNotifyURL($product_id);
-			
+
 				if (wpsg_isSizedString($url)) {
-					
+
 					$this->shop->notifyURL($url, $oOrderProduct->getProductKey(), 1, $a['order_id'], 3, array(
 						'typ' => 'abo_expiration',
@@ -582,17 +609,17 @@
 						'abo_expiration' => $a['expiration']
 					));
-					
+
 				}
                 $wpsg_mod_abo_expiremode = $this->getSetting('wpsg_mod_abo_expiremode', $product_id);
-				
+
                 if ($wpsg_mod_abo_expiremode == self::EXPIRE_AUTO) {
-				
+
                     $this->autoExtendOrder($a['order_id'], $a['order_product_id']);
-                    
+
                 } else {
 
 				    // Mail mit Benachrichtigung senden
 				    $this->sendAboExpirationMail($a['order_id'], $a['order_product_id']);
-                    
+
                 }
 
@@ -603,8 +630,8 @@
 
 			}
-            
+
             $this->shop->update_option('wpsg_mod_abo_cron_lastrun', time());
-            
-		} 
+
+		}
 
 		public function admin_emailconf_save()
@@ -640,13 +667,13 @@
                 __('E-Mail an Admin wenn Abo angehalten werden soll', 'wpsg'),
                 __('Diese Mail wird verschickt, wenn ein Kunde im Frontend ein Abo anhalten will.', 'wpsg'), true);
-             
+
             echo wpsg_drawEMailConfig(
-            	'wpsgmodabautoinfo', 
+            	'wpsgmodabautoinfo',
             	__('E-Mail bei Information vor VerlÃ€ngerung', 'wpsg'),
             	__('Diese Mail erhalten Kunden, bevor ein Abo automatisch verlÃ€ngert wird', 'wpsg'), true);
-            
+
 		} // public function admin_emailconf()
 
-		public function template_redirect() {		 
+		public function template_redirect() {
 
 			if (!isset($_REQUEST['mod']) || $_REQUEST['mod'] != 'wpsg_mod_abo') return false;
@@ -660,7 +687,7 @@
 
 			$product_key = 'abo_'.$_REQUEST['order_id'].'_'.$_REQUEST['order_product_id'];
-			
+
 			$oOrderProduct = wpsg_order_product::getInstance($_REQUEST['order_product_id']);
-						
+
 			// Kann das Abo verlÃ€ngert werden?
 			$product_data_db = $this->shop->cache->loadProduct($oOrderProduct->getProductId());
@@ -670,5 +697,5 @@
 
 			// Ist so ein Abo Produkt schon im Warenkorb?
-			$nDrin = false;			
+			$nDrin = false;
 			if (wpsg_isSizedArray($_SESSION['wpsg']['basket'])) {
 
@@ -705,5 +732,5 @@
 				if (!wpsg_isSizedArray($_SESSION['wpsg'])) $_SESSION['wpsg'] = array();
 				if (!wpsg_isSizedArray($_SESSION['wpsg']['basket'])) $_SESSION['wpsg']['basket'] = array();
- 
+
 				$_SESSION['wpsg']['basket'][] = array(
 					'menge' => '1',
@@ -715,15 +742,15 @@
 
 				$payment = $this->getSetting('wpsg_mod_abo_autoexpire_payment', $oOrderProduct->getProductId());
-				
+
 				if ($payment === 'origin') {
-				    
+
 				    $_SESSION['wpsg']['checkout']['payment'] = $oOrderProduct->getOrder()->getPaymentID();
-				    
+
                 } else {
 
                     $_SESSION['wpsg']['checkout']['payment'] = $payment;
-				    
+
                 }
-				
+
 				$this->shop->addFrontendMessage(wpsg_translate(__('Abo VerlÃ€ngerung fÃŒr Produkt #1# eingefÃŒgt', 'wpsg'), $product_data['name']));
 
@@ -744,5 +771,5 @@
 
             $nAboBuyed = $this->db->fetchOne("SELECT `rebuy` FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_id)."' AND `product_index` = '".wpsg_q($product_index)."'");
- 
+
             if ($nAboBuyed + $stock > $product_data['wpsg_mod_abo_resell'] && $product_data['wpsg_mod_abo_resell'] != '0')
             {
@@ -756,21 +783,50 @@
 		}
 
-		public function basket_toArray(&$produkt, $backend = false, $noMwSt = false)
+		public function basket_row(&$p, $i)
 		{
 
-			$product_data = $this->shop->cache->loadProduct($this->shop->getProduktID($produkt['id']));
-
-			$country = $this->shop->getDefaultCountry();
-			$mwst_value = $country->getTax($product_data['mwst_key']);
+			if (substr($p['id'], 0, 3) == 'abo')
+			{
+
+				$this->shop->view['wpsg_mod_abo']['order'] = $this->shop->cache->loadOrder($this->getOrderIDFromKey($p['id']));
+				$this->shop->view['wpsg_mod_abo']['product'] = $this->shop->cache->loadProduct($this->shop->getProduktID($p['id']));
+				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $p['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
+
+				$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/basket_row.phtml');
+
+			}
+
+		} // public function basket_row(&$p, $i)
+
+		public function overview_row(&$p, $i)
+		{
+
+			if (substr($p['id'], 0, 3) == 'abo')
+			{
+
+				$this->shop->view['wpsg_mod_abo']['order'] = $this->shop->cache->loadOrder($this->getOrderIDFromKey($p['id']));
+				$this->shop->view['wpsg_mod_abo']['product'] = $this->shop->cache->loadProduct($this->shop->getProduktID($p['id']));
+				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $p['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
+
+				$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/overview_row.phtml');
+
+			}
+
+		} // public function overview_row(&$p, $i)
+
+		public function mail_row($index, $produkt)
+		{
 
 			if (substr($produkt['id'], 0, 3) == 'abo')
 			{
 
-				// Produkt im Warenkorb ist eine VerlÃ€ngerung
-				if ($this->shop->get_option('wpsg_preisangaben') == WPSG_NETTO)
+				$this->shop->view['wpsg_mod_abo']['order'] = $this->shop->cache->loadOrder($this->getOrderIDFromKey($produkt['id']));
+				$this->shop->view['wpsg_mod_abo']['product'] = $this->shop->cache->loadProduct($this->shop->getProduktID($produkt['id']));
+				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $produkt['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
+
+				if ($this->shop->htmlMail === true)
 				{
 
-					$produkt['preis_netto'] = $product_data['wpsg_mod_abo_price'];
-					$produkt['preis_brutto'] = wpsg_calculatePreis($product_data['wpsg_mod_abo_price'], WPSG_BRUTTO, $mwst_value);
+					return $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_row_html.phtml');
 
 				}
@@ -778,64 +834,4 @@
 				{
 
-					$produkt['preis_netto'] = wpsg_calculatePreis($product_data['wpsg_mod_abo_price'], WPSG_NETTO, $mwst_value);
-					$produkt['preis_brutto'] = $product_data['wpsg_mod_abo_price'];
-
-				}
-
-			}
-
-		} // public function basket_toArray(&$produkt, $backend, $noMwSt)
-
-		public function basket_row(&$p, $i)
-		{
-
-			if (substr($p['id'], 0, 3) == 'abo')
-			{
-
-				$this->shop->view['wpsg_mod_abo']['order'] = $this->shop->cache->loadOrder($this->getOrderIDFromKey($p['id']));
-				$this->shop->view['wpsg_mod_abo']['product'] = $this->shop->cache->loadProduct($this->shop->getProduktID($p['id']));
-				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $p['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
-
-				$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/basket_row.phtml');
-
-			}
-
-		} // public function basket_row(&$p, $i)
-
-		public function overview_row(&$p, $i)
-		{
-
-			if (substr($p['id'], 0, 3) == 'abo')
-			{
-
-				$this->shop->view['wpsg_mod_abo']['order'] = $this->shop->cache->loadOrder($this->getOrderIDFromKey($p['id']));
-				$this->shop->view['wpsg_mod_abo']['product'] = $this->shop->cache->loadProduct($this->shop->getProduktID($p['id']));
-				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $p['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
-
-				$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/overview_row.phtml');
-
-			}
-
-		} // public function overview_row(&$p, $i)
-
-		public function mail_row($index, $produkt)
-		{
-
-			if (substr($produkt['id'], 0, 3) == 'abo')
-			{
-
-				$this->shop->view['wpsg_mod_abo']['order'] = $this->shop->cache->loadOrder($this->getOrderIDFromKey($produkt['id']));
-				$this->shop->view['wpsg_mod_abo']['product'] = $this->shop->cache->loadProduct($this->shop->getProduktID($produkt['id']));
-				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $produkt['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
-
-				if ($this->shop->htmlMail === true)
-				{
-
-					return $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_row_html.phtml');
-
-				}
-				else
-				{
-
 					return $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_row.phtml');
 
@@ -893,23 +889,23 @@
 
         } // public function be_ajax()
-        
+
         public function order_view($order_id, &$arSidebarArray)  {
 
             if ($this->isAboOrder($order_id) === 1) {
-                
+
                 $this->shop->view['arOrderedAboProducts'] = $this->getAboProductsFromOrder($order_id);
                 $this->shop->view['wpsg_mod_abo'] = [
-                    'oOrder' => wpsg_order::getInstance(intval($order_id))  
+                    'oOrder' => wpsg_order::getInstance(intval($order_id))
                 ];
-                
+
                 $arSidebarArray['abo'] = [
                     'title' => _('Abo Produkte'),
                     'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/order_view.phtml', false)
                 ];
-                
+
             }
-            
+
         } // public function order_view($order_id, &$arSidebarArray)
-        
+
         public function order_ajax() {
 
@@ -918,30 +914,30 @@
 
             if (wpsg_isSizedString($_REQUEST['do'], 'run')) {
-                
+
                 $oOrderProduct = wpsg_order_product::getInstance($_REQUEST['order_product_id']);
-                
-                $abo_status = $this->getAboProductStatus($_REQUEST['edit_id'], $_REQUEST['order_product_id']);                
-                $bNotify = $this->startRenewal($abo_status);                
-                $product_id = $oOrderProduct->getProductId();         
+
+                $abo_status = $this->getAboProductStatus($_REQUEST['edit_id'], $_REQUEST['order_product_id']);
+                $bNotify = $this->startRenewal($abo_status);
+                $product_id = $oOrderProduct->getProductId();
                 $wpsg_mod_abo_expiremode = $this->getSetting('wpsg_mod_abo_expiremode', $product_id);
-                
+
                 if ($wpsg_mod_abo_expiremode === self::EXPIRE_AUTO) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird wieder automatisch eine Bestellung ausgelÃ¶st.', 'wpsg'));
                 else if ($wpsg_mod_abo_expiremode === self::EXPIRE_MAIL) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird dem Kunden wieder die MÃ¶glichkeit gegeben mit einer neuen Bestellung das Abo zu verlÃ€ngern.', 'wpsg'));
 
                 if ($bNotify) $this->shop->addBackendMessage(__('URL Benachrichtigung ausgelÃ¶st. (type=abo_status_started)', 'wpsg'));
-                
+
                 $this->shop->redirect(
                     wpsg_admin_url('Order', 'view', ['edit_id' => $_REQUEST['edit_id']])
                 );
-                
+
             } else if (wpsg_isSizedString($_REQUEST['do'], 'stop')) {
 
                 $oOrderProduct = wpsg_order_product::getInstance($_REQUEST['order_product_id']);
-                
+
                 $abo_status = $this->getAboProductStatus($_REQUEST['edit_id'], $_REQUEST['order_product_id']);
                 $bNotify = $this->stopRenewal($abo_status);
                 $product_id = $oOrderProduct->getProductId();
                 $wpsg_mod_abo_expiremode = $this->getSetting('wpsg_mod_abo_expiremode', $product_id);
-                
+
                 if ($wpsg_mod_abo_expiremode === self::EXPIRE_AUTO) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird keine Bestellung mehr ausgelÃ¶st.', 'wpsg'));
                 else if ($wpsg_mod_abo_expiremode === self::EXPIRE_MAIL) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird dem Kunden keine MÃ¶glichkeit gegeben mit einer neuen Bestellung das Abo zu verlÃ€ngern.', 'wpsg'));
@@ -954,5 +950,5 @@
 
             }
-            
+
         }
 
@@ -963,5 +959,5 @@
             $arFields[10]['fields']['wpsg_mod_abo_price'] = __('Abo Kosten VerlÃ€ngerung', 'wpsg');
             $arFields[10]['fields']['wpsg_mod_abo_duration'] = __('Abo Dauer (Tage)', 'wpsg');
-            
+
         }
 
@@ -969,30 +965,30 @@
 
             if (!in_array($field_value, ['wpsg_mod_abo_runningtime', 'wpsg_mod_abo_starttime', 'wpsg_mod_abo_price', 'wpsg_mod_abo_duration'])) return;
-            
+
             $return = '';
-            
+
             $abo_order = $this->isAboOrder($o_id);
             $abo_order_id = 0;
-            
+
             if ($abo_order === false) return;
             else if ($abo_order === 1) $abo_order_id = $o_id;
             else if ($abo_order === 2) $abo_order_id = $this->getOriginOrder($o_id);
-            
+
             $arAboProducts = $this->getAboProductsFromOrder($abo_order_id);
             $arProductExportKeys = [];
-            
+
             if (wpsg_isSizedInt($p_id)) {
 
                 /** @var \wpsg_order_product $oOrderProduct */
                 foreach ($arAboProducts as $oOrderProduct) {
-                    
+
                     if ($oOrderProduct->getProductKey() == $product_key) {
-                        
+
                         $arProductExportKeys[] = $product_key;
-                        
+
                     }
-                    
+
                 }
-                
+
             } else {
 
@@ -1001,23 +997,23 @@
 
                     $arProductExportKeys[] = $oOrderProduct->getProductKey();
-                    
+
                 }
-                
+
             }
-            
+
             if (wpsg_isSizedArray($arProductExportKeys)) {
-            
+
                 if ($field_value === 'wpsg_mod_abo_runningtime') {
-            
+
                     foreach ($arProductExportKeys as $product_key) {
-                        
+
                         $abo_info = $this->getAboProductStatus($abo_order_id, $product_key);
-                        
+
                         $arReturn[] = wpsg_fromDate($abo_info['expiration']);
-                        
+
                     }
-                    
-                    $return = implode(',', $arReturn); 
-                    
+
+                    $return = implode(',', $arReturn);
+
                 } else if ($field_value === 'wpsg_mod_abo_starttime') {
 
@@ -1035,13 +1031,13 @@
 
                     foreach ($arProductExportKeys as $product_key) {
-                     
+
                         $oProduct = wpsg_product::getInstance($this->shop->getProduktID($product_key));
-                        
+
                         $arReturn[] = wpsg_ff($oProduct->wpsg_mod_abo_price);
-                                                
+
                     }
-                    
+
                     $return = implode(',', $arReturn);
-                    
+
                 } else if ($field_value === 'wpsg_mod_abo_duration') {
 
@@ -1055,39 +1051,39 @@
 
                     $return = implode(',', $arReturn);
-                    
+
                 }
-                
+
             }
-                        
+
         }
-        
+
 		/** Modulfunktionen */
 
         public function getSetting($key, $product_id = null) {
-            
+
             if ($product_id !== null) {
-                
+
                 $oProduct = wpsg_product::getInstance($product_id);
-                
+
                 $meta_value = $oProduct->getMeta($key, false, self::CONFIG);
-                
+
                 if ($meta_value !== self::CONFIG) return $meta_value;
-                
+
             }
-            
+
             return $this->shop->get_option($key);
-            
+
         }
-        
+
         private function admin_inlineEditAction() {
-            
+
             $order_id = intval($_REQUEST['order_id']);
             $order_product_id = intval($_REQUEST['order_product_id']);
             $tDate = strtotime($_REQUEST['date']);
-            
+
             if ($tDate <= 0) throw new \wpsg\Exception(__('Kein Datum ÃŒbergeben.', 'wpsg'));
-            
+
             $tDate += 3600; // TODO: KlÃ€ren warum das nicht richtig von x-editable geparsed wird, find es jetzt nicht
-            
+
             $this->db->UpdateQuery(WPSG_TBL_ABO, [
                 'expiration' => wpsg_q(date('Y-m-d H:i:s', $tDate))
@@ -1095,14 +1091,14 @@
 
             $oAbo = wpsg_abo::getFromOrderAndOrderProduct($order_id, $order_product_id);
-            
+
             wpsg_header::JSONData([
                 'state' => $oAbo->getState(),
                 'time' => wpsg_formatTimestamp($tDate)
             ]);
-            
+
             exit;
-            
+
         }
-        
+
         /**
          * VerlÃ€ngerung anhalten
@@ -1115,5 +1111,5 @@
 
             $url = $this->getNotifyURL($oOrderProduct->getProductId());
-                
+
             if (wpsg_isSizedString($url)) {
 
@@ -1122,17 +1118,17 @@
                     'abo_baseOrderID' => $abo_status['order_id']
                 ));
-                
+
                 return true;
-   
+
             }
-            
+
             $oProduct = $oOrderProduct->getProduct();
-            
+
             // Protokoll
             $oOrder = wpsg_order::getInstance($abo_status['order_id']);
             $oOrder->log(wpsg_translate(__('Abo fÃŒr Produkt #1# wure angehalten.', 'wpsg'), $oProduct->getProductName()), '');
-            
+
             return false;
-            
+
         } // private function stopRenewal()
 
@@ -1161,5 +1157,5 @@
 
                 return true;
-                
+
             }
 
@@ -1169,9 +1165,9 @@
             $oOrder = wpsg_order::getInstance($abo_status['order_id']);
             $oOrder->log(wpsg_translate(__('Abo fÃŒr Produkt #1# wurde fortgesetzt.', 'wpsg'), $oProduct->getProductName()), '');
-            
+
             return false;
 
         } // private function startRenewal($abo_status)
-        
+
         /**
          * Frontend: Anhalten von Abo VerlÃ€ngerungen
@@ -1181,72 +1177,72 @@
 	        $_REQUEST['order_id'] = wpsg_sinput("key", $_REQUEST['order_id']);
             $oOrder = wpsg_order::getInstance($_REQUEST['order_id']);
-            
+
             // SicherheitsÃŒberprÃŒfung
             if (!wpsg_isSizedInt($_SESSION['wpsg']['checkout']['id']) || $oOrder->k_id != $_SESSION['wpsg']['checkout']['id']) throw new \wpsg\Exception(__('Nicht angemeldet oder kein Zugriff auf diese Bestellung.', 'wpsg'));
 
             $arOrderProducts = $this->getAboProductsFromOrder($oOrder->id);
-            
+
             foreach ($arOrderProducts as $oOrderProduct) {
 
                 $abo_status = $this->getAboProductStatus($oOrder->id, $oOrderProduct->getId());
- 
+
                 if ($oOrderProduct->getProductKey() === $_REQUEST['product_key'] && wpsg_isSizedInt($abo_status['id'])) {
-                           
+
                     $wpsg_mod_abo_autoexpire_customer = $this->getSetting('wpsg_mod_abo_autoexpire_customer', $oOrderProduct->getProductId());
-                    
+
                     // Hier ist alles ok, das Abo kann gestoppt werden
                     if ($wpsg_mod_abo_autoexpire_customer === wpsg_mod_abo::CUSTOMER_AUTO_DIRECT) {
-                        
+
                         $this->stopRenewal($abo_status);
 
                         $this->shop->addFrontendMessage(__('Die VerlÃ€ngerung ihres Abos wurde angehalten.', 'wpsg'));
                         $this->shop->redirect($this->shop->getURL(wpsg_ShopController::URL_ABO));
-                        
+
                     }
                     else if ($wpsg_mod_abo_autoexpire_customer === wpsg_mod_abo::CUSTOMER_AUTO_MAIL)
                     {
-                        
+
                         try
                         {
-                        
+
                             $this->sendAdminMailStopRenewal($abo_status);
-                        
+
                             $this->shop->addFrontendMessage(__('Der Administrator wurde informiert und wird die VerlÃ€ngerung ihres Abos veranlassen.', 'wpsg'));
-                            
-                        } 
+
+                        }
                         catch (\wpsg\Exception $ex)
                         {
-                        
+
                             $this->shop->addFrontendMessage($ex->getMessage());
-                            
+
                         }
 
                         $this->shop->redirect($this->shop->getURL(wpsg_ShopController::URL_ABO));
-                        
+
                     }
                     else throw new \wpsg\Exception(__('Funktion ist deaktiviert.', 'wpsg'));
-                    
+
                 }
-                
+
             }
-            
+
             throw new \wpsg\Exception(__('Produkt nicht in Bestellung gefunden.', 'wpsg'));
 
         } // public function stoprenewalRedirect()
-                
+
         /**
          * Sendet eine Mail an den Admin, wenn ein Kunde ein Abo anhalten mÃ¶chte
-         * 
+         *
          * @param $abo_status
          */
         private function sendAdminMailStopRenewal($abo_status)
         {
-            
+
             if (strtotime($abo_status['mail_admin_stop']) > 0) throw new \wpsg\Exception(wpsg_translate(__('Admin wurde bereits am #1# benachrichtigt das Abo zu stoppen.'), wpsg_formatTimestamp($abo_status['mail_admin_stop'], false)));
-            
+
             $this->db->UpdateQuery(WPSG_TBL_ABO, Array(
                 'mail_admin_stop' => 'NOW()'
             ), " `id` = '".wpsg_q($abo_status['id'])."' ");
-            
+
             // Mail senden
             $this->shop->view['oOrder'] = wpsg_order::getInstance($abo_status['order_id']);
@@ -1254,10 +1250,10 @@
             $this->shop->view['oProduct'] = wpsg_product::getInstance($abo_status['product_key']);
             $this->shop->view['product_key'] = $abo_status['product_key'];
-            
+
             if ($this->shop->get_option('wpsg_htmlmail') === '1') $mail_html = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_admin_stoprenewal_html.phtml', false);
             else $mail_html = false;
 
             $mail_text = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_admin_stoprenewal.phtml', false);
- 
+
             $to = $this->shop->get_option('wpsg_wpsgmodaboadminstoprenewal_empfaenger');
 
@@ -1267,7 +1263,7 @@
             $oOrder = wpsg_order::getInstance($abo_status['order_id']);
             $oOrder->log(wpsg_translate(__('Mail an Administrator (Abo anhalten)', 'wpsg'), $oProduct->getProductName()), $mail_text);
-            
+
             $this->shop->sendMail($mail_text, $to, 'wpsgmodaboadminstoprenewal', array(), $abo_status['order_id'], false, $mail_html);
-            
+
         } // private function sendAdminMailStopRenewal($abo_status)
 
@@ -1279,11 +1275,11 @@
         private function sendCustomerMailResign($abo_status)
         {
-        	
+
         	if (strtotime($abo_status['mail_admin_stop']) > 0) throw new \wpsg\Exception(wpsg_translate(__('Admin wurde bereits am #1# benachrichtigt das Abo zu stoppen.'), wpsg_formatTimestamp($abo_status['mail_admin_stop'], false)));
-        	
+
         	$this->db->UpdateQuery(WPSG_TBL_ABO, Array(
         			'mail_admin_stop' => 'NOW()'
         			), " `id` = '".wpsg_q($abo_status['id'])."' ");
-        	
+
         	// Mail senden
         	$this->shop->view['oOrder'] = wpsg_order::getInstance($abo_status['order_id']);
@@ -1291,26 +1287,26 @@
         	$this->shop->view['oProduct'] = wpsg_product::getInstance($abo_status['product_key']);
         	$this->shop->view['product_key'] = $abo_status['product_key'];
-        	
+
         	if ($this->shop->get_option('wpsg_htmlmail') === '1') $mail_html = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_storno_html.phtml', false);
         	else $mail_html = false;
-        	
+
         	$mail_text = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_storno.phtml', false);
-        	
+
         	//$to = $this->shop->get_option('wpsg_wpsgmodaboadminstoprenewal_empfaenger');
         	$to = $this->shop->view['customer']['email'];
-        	
+
         	$oProduct = wpsg_product::getInstance($this->shop->getProduktID($abo_status['product_key']));
-        	
+
         	// Protokoll
         	$oOrder = wpsg_order::getInstance($abo_status['order_id']);
         	$oOrder->log(wpsg_translate(__('Mail an Kunden (Abo gekÃŒndigt)', 'wpsg'), $oProduct->getProductName()), $mail_text);
-        	
+
         	$this->shop->sendMail($mail_text, $to, 'wpsgmodaboadminresign', array(), $abo_status['order_id'], false, $mail_html);
-        	
+
         } // private function sendCustomerMailResign($abo_status)
 
         /**
          * Erstellt automatisch eine Bestellung wenn ein Abo ausgelaufen ist
-         * 
+         *
          * @param $order_id
          * @param $product_key
@@ -1337,12 +1333,12 @@
 
 		    if (!is_numeric($product_id)) throw new \Exception(__('Nicht vorgesehen!', 'wpsg'));
-		    
+
             $this->shop->addShipPay();
-            
-            $oOrder = wpsg_order::getInstance($order_id); 
- 
+
+            $oOrder = wpsg_order::getInstance($order_id);
+
             unset($_SESSION['wpsg']['basket']);
             unset($_SESSION['wpsg']['checkout']);
- 
+
             $_SESSION['wpsg']['checkout']['id'] = $oOrder->k_id;
 
@@ -1358,10 +1354,10 @@
 
             }
-            
+
             $_SESSION['wpsg']['checkout']['shipping'] = $oOrder->type_shipping;
-            
+
             $customer_db_data = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_KU."` WHERE `id` = '".wpsg_q($oOrder->k_id)."' ");
             $customer_address = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ADRESS."` WHERE `id` = '".wpsg_q($customer_db_data['adress_id'])."' ");
-             
+
             $_SESSION['wpsg']['checkout']['firma'] = wpsg_getStr($customer_address['firma']);
             $_SESSION['wpsg']['checkout']['title'] = wpsg_getStr($customer_address['title']);
@@ -1377,7 +1373,7 @@
             $_SESSION['wpsg']['checkout']['ort'] = wpsg_getStr($customer_address['ort']);
             $_SESSION['wpsg']['checkout']['land'] = wpsg_getStr($customer_address['land']);
-                     
+
             $oBasket = new wpsg_basket();
-          
+
             $oBasket->addProduktToSession('abo_'.$order_id.'_'.$order_product_id, 1);
 
@@ -1388,16 +1384,16 @@
             $arBasket['checkout']['onr'] = $this->db->fetchOne("SELECT `onr` FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($new_o_id)."' ");
             $arBasket['checkout']['datum'] = time();
- 
-            $bCustomerMail = false;  
+
+            $bCustomerMail = false;
             $bAdminMail = false;
-            
+
             if ($this->getSetting('wpsg_mod_abo_autoexpire_customermail', $product_id) === '1') $bCustomerMail = true;
             if ($this->getSetting('wpsg_mod_abo_autoexpire_adminmail', $product_id) === '1') $bAdminMail = true;
-            
+
             $oOrder->addLogEntry(__('VerlÃ€ngerung erworben', 'wpsg'), 'OrderID: '.$new_o_id);
-            
+
             $oBasket->sendOrderSaveMails($new_o_id, $arBasket, $bCustomerMail, $bAdminMail);
-            
-        }  
+
+        }
 
         /**
@@ -1407,25 +1403,25 @@
          */
         public function getAboProductsFromOrder($order_id) {
-            
+
             $oOrder = wpsg_order::getInstance($order_id);
             $arOrderProducts = Array();
-            
+
             foreach ($oOrder->getOrderProducts() as $oOrderProduct) {
-                
+
                 if ($oOrderProduct->getProduct()->wpsg_mod_abo_activ) {
-                    
+
                     $arOrderProducts[] = $oOrderProduct;
-                    
+
                 }
-                
+
             }
-            
+
             return $arOrderProducts;
-            
+
         } // public function getAboProductsFromOrder($order_id)
 
         /**
          * Gibt die Informationen zu dem Abo aus der Abo Tabelle zurÃŒck
-         * 
+         *
          * @param $order_id
          * @param $product_key
@@ -1433,11 +1429,11 @@
          */
         public function getAboProductStatus($order_id, $order_product_id) {
-            
+
             $abo_product = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_id)."' AND `order_product_id` = '".wpsg_q($order_product_id)."' ");
-            
+
             return $abo_product;
-                        
-        }  
-        
+
+        }
+
 		/**
 		 * Gibt das Datum im MySQL Format zurÃŒck, wann das Abo ablÃ€uft wenn es heute gekauft wird
@@ -1454,11 +1450,11 @@
 
         public function isAboExtensionProductKey($product_key) {
-		    
+
 		    if (preg_match('/^abo\_\d+\_\d+$/', $product_key)) {
-		        
+
 		        return true;
-		        
+
             } else return false;
-		    
+
         }
 
@@ -1469,13 +1465,13 @@
          */
         public function getProductIDFromAboExtensionProductKey($product_key) {
-		    
+
 		    $arKey = explode('_', $product_key);
-		    
+
 		    $oOrderProduct = wpsg_order_product::getInstance(intval($arKey[2]));
-		    
+
 		    return $oOrderProduct->getProductId();
-		    
+
         }
-        
+
 		/**
 		 * Gibt false zurÃŒck wenn die Bestellung keine Abo Bestellung ist
@@ -1488,9 +1484,9 @@
             $nFolgeBestellung = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `o_id` = '".wpsg_q($order_id)."' AND `productkey` REGEXP '^abo_[0-9]+_[0-9]+' ");
             if ($nFolgeBestellung > 0) return 2;
-            
+
 			// Bei Originalbestellungen gibt es einen eintrag in der Tabelle
 			$nAboBestellung = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_id)."'");
 			if ($nAboBestellung > 0) return 1;
-            
+
 			return false;
 
@@ -1527,5 +1523,5 @@
 		/**
 		 * Gibt das Auslaufdatum einer Abobestellung zurÃŒck
-         * 
+         *
 		 * @param unknown_type $order_id
 		 */
@@ -1533,14 +1529,20 @@
 
 			$data = null;
-            
+
+			$abo = wpsg_abo::getFromOrderAndOrderProduct($order_id, $order_product_id);
+
+			$data = $abo->__get('expiration');
+
+			/*
 			$data = wpsg_fromDate($this->db->fetchOne("
-                SELECT 
-                    `expiration` 
-                FROM 
-                    `".WPSG_TBL_ABO."` 
-                WHERE 
+                SELECT
+                    `expiration`
+                FROM
+                    `".WPSG_TBL_ABO."`
+                WHERE
                     `order_id` = '".wpsg_q($order_id)."' AND
                     `order_product_id` = '".wpsg_q($order_product_id)."'
             "), false);
+			*/
 
 			return $data;
Index: /mods/wpsg_mod_basketteaser.class.php
===================================================================
--- /mods/wpsg_mod_basketteaser.class.php	(revision 7892)
+++ /mods/wpsg_mod_basketteaser.class.php	(revision 7893)
@@ -148,27 +148,15 @@
 		 * Gibt einen Array mit Produktids zurÃŒck fÃŒr die aktuell anzuteasernden Produkte
 		 */
-		private function getTeaserProducts()
-		{
+		private function getTeaserProducts() {
 			
 			$arProdukteBasket = array();
 			
-			if (is_object($this->shop->basket) && is_array($this->shop->basket->toArray()))
-			{
+			if (is_object($this->shop->basket) && is_array($this->shop->basket->toArray())) {
 				
 				$arBasket = $this->shop->basket->toArray();
 				 
-				foreach ($arBasket['produkte'] as $p)
-				{
-					
-					if (preg_match('/pv_(.*)/', $p['id']))
-					{
-						$produkt_id = preg_replace('/(pv_)|(\|(.*))/', '', $p['id']);
-					}
-					else 
-					{
-						$produkt_id = $p['id'];
-					}
-					
-					$arProdukteBasket[] = $produkt_id;
+				foreach ($arBasket['produkte'] as $p) {
+
+					$arProdukteBasket[] = $this->shop->getProduktID($p['id']);
 					
 				}
@@ -187,6 +175,5 @@
 			";
 			
-			if (wpsg_isSizedArray($arProdukteBasket))
-			{
+			if (wpsg_isSizedArray($arProdukteBasket)) {
 			
 				$strQuery .= " AND P.`id` NOT IN (".implode(",", $arProdukteBasket).") ";
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 7892)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 7893)
@@ -438,12 +438,9 @@
 
 				// Gesetzte Variante wÃ€hlen und aufwerten
-				foreach ($product_data['arVariant'] as $var_id => $var_data)
-				{
-
-					foreach ($var_data['arVariation'] as $vari_id => $vari_data)
-					{
-
-						if ($arProductKey['arVari'][$var_id] == $vari_id)
-						{
+				foreach ($product_data['arVariant'] as $var_id => $var_data) {
+
+					foreach ($var_data['arVariation'] as $vari_id => $vari_data) {
+
+						if (wpsg_getInt($arProductKey['arVari'][$var_id]) == $vari_id) {
 
 							$vari_data['pics']= explode(',', $vari_data['images_set']);
Index: /mods/wpsg_mod_scaleprice.class.php
===================================================================
--- /mods/wpsg_mod_scaleprice.class.php	(revision 7892)
+++ /mods/wpsg_mod_scaleprice.class.php	(revision 7893)
@@ -365,7 +365,6 @@
 		}
 		
-		public function loadProduktArray0(&$product_data)
-		{
- 
+		public function loadProduktArray0(&$product_data) {
+
 			$product_key = $product_data['id'];
 			$product_id = $this->shop->getProduktId($product_key);
Index: /mods/wpsg_mod_weight.class.php
===================================================================
--- /mods/wpsg_mod_weight.class.php	(revision 7892)
+++ /mods/wpsg_mod_weight.class.php	(revision 7893)
@@ -282,5 +282,5 @@
 			{
 
-				$weight = $product_data_db['weight'];
+				$weight = wpsg_getFloat($product_data_db['weight']);
 
 			}
Index: /views/warenkorb/basket.phtml
===================================================================
--- /views/warenkorb/basket.phtml	(revision 7892)
+++ /views/warenkorb/basket.phtml	(revision 7893)
@@ -7,5 +7,5 @@
 	//wpsg_debug($this->view['basket']);
 	//wpsg_debug($this->view['basket']['arCalculation']);
-	//wpsg_debug($_SESSION['wpsg']);
+    wpsg_debug($_SESSION['wpsg']);
 	//wpsg_debug($this->arShipping);
 
Index: /wpshopgermany.php
===================================================================
--- /wpshopgermany.php	(revision 7892)
+++ /wpshopgermany.php	(revision 7893)
@@ -25,5 +25,5 @@
 		
 	}
-	
+
 	// Tabellen
 	define('WPSG_TBL_ADRESS', $prefix.'wpsg_adress');
@@ -175,5 +175,5 @@
 	require_once(dirname(__FILE__).'/controller/wpsg_BasketController.class.php');
 	require_once(dirname(__FILE__).'/controller/wpsg_OrderController.class.php');
-	
+
 	$_GET['wpsg_quotecheck'] = '\"CHECK';
 	
