Index: /controller/wpsg_BasketController.class.php
===================================================================
--- /controller/wpsg_BasketController.class.php	(revision 7703)
+++ /controller/wpsg_BasketController.class.php	(revision 7704)
@@ -334,9 +334,9 @@
 				if ($this->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
 				
-				$this->_outputCache['overview'] = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/overview.phtml', false);
+				self::$_outputCache['overview'] = $this->shop->render(WPSG_PATH_VIEW.'/warenkorb/overview.phtml', false);
 	
 			 }
 			
-			$content = $this->_outputCache['overview'];
+			$content = self::$_outputCache['overview'];
 			
 		} // private function overviewAction()
@@ -481,5 +481,5 @@
 				$amount = intval($_REQUEST['wpsg']['menge']);
 				$bOK = $this->shop->basket->addProduktToSession($product_key, $amount);
-				
+
 				if ($this->shop->get_option('wpsg_afterinsert') == '2') die();
 				
Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 7703)
+++ /controller/wpsg_OrderController.class.php	(revision 7704)
@@ -1368,5 +1368,5 @@
 					`".WPSG_TBL_LAND."` AS C
 				WHERE
-					C.`id` = '".$this->shop->view['data']['shipping_land']."'
+					C.`id` = '".wpsg_q(wpsg_getStr($this->shop->view['data']['shipping_land']))."'
 			");
 
Index: /controller/wpsg_ProduktController.class.php
===================================================================
--- /controller/wpsg_ProduktController.class.php	(revision 7703)
+++ /controller/wpsg_ProduktController.class.php	(revision 7704)
@@ -701,6 +701,5 @@
 
 			$this->shop->view['partikel_select'] = array();
-
-			$this->shop->view['partikel_select']['davor'][1]['']= 'Nicht zugeordnet';
+            $this->shop->view['partikel_select']['davor'] = [__('Allgemein', 'wpsg'), [0 => __('Nicht zugeordnet', 'wpsg')]];
 
 			$arArtikel = get_posts('numberposts=-1'); if (wpsg_isSizedArray($arArtikel)) {
@@ -936,4 +935,5 @@
 				wpsg_checkRequest('posturl_bezahlung', [WPSG_SANITIZE_CHECKBOX], __('URL Benachrichtigung / Bei Bezahlung', 'wpsg'), $data);
 				wpsg_checkRequest('partikel', [WPSG_SANITIZE_INT, ['allowEmpty' => true]], __('Zugeordneter Wordpress Artikel', 'wpsg'), $data);
+
 				wpsg_checkRequest('basket_multiple', [WPSG_SANITIZE_VALUES, [wpsg_product::MULTIPLE_ONE_MULTI, wpsg_product::MULTIPLE_MULTI_MULTI, wpsg_product::MULTIPLE_MULTI_ONE, wpsg_product::MULTIPLE_ONE_ONE]], __('Produkt unterliegt den EU-Leistungsortregeln', 'wpsg'), $data);
 				wpsg_checkRequest('rating', [WPSG_SANITIZE_VALUES, ['-1', '0', '1', '2', '3', '4', '5']], __('Bewertungspunkte', 'wpsg'), $data);
@@ -1028,11 +1028,12 @@
 
 			$this->shop->view['partikel_select'] = array();
+            $this->shop->view['partikel_select']['davor'] = [__('Allgemein', 'wpsg'), [0 => __('Nicht zugeordnet', 'wpsg')]];
 
 			$arArtikel = get_posts('numberposts=-1'); if (wpsg_isSizedArray($arArtikel)) {
 
-			$this->shop->view['partikel_select']['article'] = array(__('Artikel', 'wpsg'), array());
-			foreach ($arArtikel as $a) $this->shop->view['partikel_select']['article'][1][$a->ID] = $a->post_title;
-
-		}
+                $this->shop->view['partikel_select']['article'] = array(__('Artikel', 'wpsg'), array());
+                foreach ($arArtikel as $a) $this->shop->view['partikel_select']['article'][1][$a->ID] = $a->post_title;
+
+            }
 
 			$arPages = get_pages(); if (wpsg_isSizedArray($arPages)) {
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7703)
+++ /controller/wpsg_ShopController.class.php	(revision 7704)
@@ -1117,6 +1117,8 @@
 
 				if (method_exists($m, $func_name)) {
- 
+
 					$b = call_user_func_array(array($m, $func_name), $arParam);
+
+                    //echo $m_key.":".$func_name.":".$b."\r\n";
 
 					if ($b == -1) break;
@@ -3404,5 +3406,5 @@
 			 
 			\apply_filters('wpsg_sendMail', [$mail_key, $o_id, $k_id, &$empfaenger, &$subject, &$mail_text_send, &$headers, &$anhang]);
-            
+
 			wp_mail($empfaenger, $subject, $mail_text_send, $headers, $anhang);
 
Index: /controller/wpsg_SystemController.class.php
===================================================================
--- /controller/wpsg_SystemController.class.php	(revision 7703)
+++ /controller/wpsg_SystemController.class.php	(revision 7704)
@@ -149,18 +149,25 @@
         	
 			$result = \wp_remote_post($url, [
-				'body' => http_build_query($post_data, null, '&'),
-				
+				'body' => http_build_query($post_data, null, '&')
 			]);
-        	 
-            return $result['body'];
+
+            if (is_object($result) && get_class($result) == 'WP_Error') {
+
+                throw new \wpsg\Exception($result->errors);
+
+            } else return $result['body'];
 
         } // public function get_url_post_content($url, $post_data = array())
-		
-		/**
-		 * Gibt die Antwort einer URL zurÃŒck
-		 */
+
+        /**
+         * Gibt die Antwort einer URL zurÃŒck
+         * @throws \wpsg\Exception
+         */
 		public function get_url_content($url) {
-			
-			return \wp_remote_get($url, [])['body'];
+
+            $result = \wp_remote_get($url, []);
+
+			if (is_array($result)) return $result['body'];
+			else throw new \wpsg\Exception($result->errors);
 			 			
 		} // public function get_url_content($url)
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 7703)
+++ /lib/functions.inc.php	(revision 7704)
@@ -758,5 +758,5 @@
 		if (isset($arCheckInputArguments[1])) $param = $arCheckInputArguments[1];
 		
-		if ($value === null) $value = $_REQUEST[$name]; 
+		if ($value === null && isset($_REQUEST[$name])) $value = $_REQUEST[$name];
 		
 		if (!wpsg_checkInput($value, $type, $param)) {
Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 7703)
+++ /lib/wpsg_basket.class.php	(revision 7704)
@@ -82,5 +82,5 @@
 				// Nur einmal mit beliebiger Menge
 				// Hier nichts machen, es wird weiter unten hinzugefÃŒgt
-				
+
 			}
 			else if ($product_data['basket_multiple'] == 2)
@@ -171,5 +171,5 @@
 		 
 			$bOK = $this->shop->callMods('basket_produkttosession', array($produkt_key, &$menge, &$ses_data));
-			
+
 			if ($bOK === false) return false;
 			
@@ -180,5 +180,5 @@
 				'referer' => ''
 			));
-			
+
 			if (isset($_REQUEST['myReferer'])) $ses_data['referer'] = $_REQUEST['myReferer'];
 			
@@ -307,15 +307,5 @@
 				
 			}
-			
-			if (isset($_SESSION['wpsg']['gs']))
-			{
-				
-				$this->gs_value = $_SESSION['wpsg']['gs']['value'];
-				$this->gs_calc = $_SESSION['wpsg']['gs']['calc'];
-				$this->gs_code = $_SESSION['wpsg']['gs']['code'];
-				$this->gs_id = $_SESSION['wpsg']['gs']['id'];
-				
-			}
-			
+
 			$this->arCheckout = wpsg_array_merge(array(
 				'firma' => '',
Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 7703)
+++ /lib/wpsg_calculation.class.php	(revision 7704)
@@ -809,9 +809,9 @@
             	
             	if ($cr['type'] === 'discount') {
-		
+
 					$db_data['discount_set'] = wpsg_q($cr['set']);
 					$db_data['discount_bruttonetto'] = wpsg_q($cr['bruttonetto']);
 					$db_data['discount_tax_key'] = wpsg_q($this->clearTaxKey($cr['tax_key']));
-					$db_data['price_rabatt'] = wpsg_q($arCalculation['sum']['discount'.$display]);
+					$db_data['price_rabatt'] = wpsg_q($arCalculation['sum']['discount_'.$display]);
 					$db_data['price_rabatt_netto'] = wpsg_q($arCalculation['sum']['discount_netto']);
 					$db_data['price_rabatt_brutto'] = wpsg_q($arCalculation['sum']['discount_brutto']);
@@ -970,15 +970,20 @@
 				
 				if (wpsg_isSizedInt($p['order_product_id'])) {
-					
-					$arOrderProductID[] = $p['order_product_id'];
-			
+
 					$this->db->UpdateQuery(WPSG_TBL_ORDERPRODUCT, $db_data, " `id` = '".wpsg_q($p['order_product_id'])."' ");
 					
 				} else {
-			
-					$arOrderProductID[] = $this->db->ImportQuery(WPSG_TBL_ORDERPRODUCT, $db_data);
-					
-				}
-			
+
+                    $p['order_product_id'] = $this->db->ImportQuery(WPSG_TBL_ORDERPRODUCT, $db_data);
+					
+				}
+
+                $arOrderProductID[] = $p['order_product_id'];
+
+                if (!is_admin()) {
+
+                    $this->shop->callMods('calculation_saveProduct_after', [&$this, $p, &$db_data, $finish_order]);
+
+                }
 				
             }
@@ -1204,5 +1209,5 @@
 				$payment = $this->shop->arPayment[$_SESSION['wpsg']['checkout']['payment']];
 												
-				if (wpsg_isSizedArray($payment)) $this->addPayment($payment['price'], $this->shop->getBackendTaxview(), @$payment['tax_key'], $_SESSION['wpsg']['checkout']['payment']);
+				if (wpsg_isSizedArray($payment)) $this->addPayment(wpsg_getFloat($payment['price']), $this->shop->getBackendTaxview(), @$payment['tax_key'], $_SESSION['wpsg']['checkout']['payment']);
 				
 			}
Index: /lib/wpsg_db.class.php
===================================================================
--- /lib/wpsg_db.class.php	(revision 7703)
+++ /lib/wpsg_db.class.php	(revision 7704)
@@ -241,7 +241,8 @@
 			$strQuery = "UPDATE `".wpsg_q($table)."` SET ";
 			
-			foreach ($data as $k => $v)
-			{
-				
+			foreach ($data as $k => $v) {
+
+			    if (is_array($v)) var_dump($k);
+
 				if ($v != "NOW()" && $v != "NULL") $v = "'".$v."'";
 					
Index: /model/wpsg_exception.class.php
===================================================================
--- /model/wpsg_exception.class.php	(revision 7703)
+++ /model/wpsg_exception.class.php	(revision 7704)
@@ -70,5 +70,11 @@
         	return new \Exception('Aufrufsfehler');
         	
-		} 
+		}
+
+		public static function getInvalidFunctionException() {
+
+            return new \Exception('UngÃŒltiger Aufruf');
+
+        }
         
     } // class exception extends \Exception
Index: /model/wpsg_model.class.php
===================================================================
--- /model/wpsg_model.class.php	(revision 7703)
+++ /model/wpsg_model.class.php	(revision 7704)
@@ -10,5 +10,5 @@
 		/** @var array */
 		public static $_objCache = array();
-		
+
 		/** @var wpsg_db */
 		var $db = false;
@@ -35,5 +35,5 @@
 		public function getId() {
 			
-			return intval($this->data['id']);
+			return intval($this->data['id']??'');
 			
 		}
@@ -150,4 +150,65 @@
 			
 		}
-				
+
+        /**
+         * Setzt einen Wert in der META Tabelle
+         * @param $meta_key
+         * @param null $meta_value
+         * @throws \wpsg\Exception
+         */
+        public function setMeta($meta_key, $meta_value = null) {
+
+            $class = get_called_class();
+
+            if ($class::$_tableName === null) throw \wpsg\Exception::getInvalidValueException();
+            if (!wpsg_isSizedInt($this->id)) throw \wpsg\Exception::getInvalidValueException();
+
+            $target_id = intval($this->id);
+
+            if ($target_id <= 0) throw \wpsg\Exception::getInvalidValueException();
+
+            if (is_null($meta_value)) {
+
+                $this->db->Query("DELETE FROM `".WPSG_TBL_META."` WHERE `meta_key` = '".wpsg_q($meta_key)."' AND `target_id` = '".wpsg_q($this->id)."' AND `meta_table` = '".wpsg_q($class::$_tableName)."' ");
+
+            } else {
+
+                $nExistsID = $this->db->fetchOne("SELECT M.`id` FROM `".WPSG_TBL_META."` AS M WHERE M.`meta_table` = '".wpsg_q($class::$_tableName)."' 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),
+                        'meta_table' => wpsg_q($class::$_tableName),
+                        'meta_key' => wpsg_q($meta_key),
+                        'meta_value' => wpsg_q($meta_value)
+                    ));
+
+                }
+
+            }
+
+        } // public function setMeta($meta_key, $meta_value)
+
+        /**
+         * Gibt einen META Value zurÃŒck
+         */
+        public function getMeta($meta_key) {
+
+            $class = get_called_class();
+
+            if ($class::$_tableName === null) throw \wpsg\Exception::getInvalidValueException();
+
+            $meta_value = $this->db->fetchOne("SELECT M.`meta_value` FROM `".WPSG_TBL_META."` AS M WHERE M.`meta_table` = '".wpsg_q($class::$_tableName)."' AND M.`meta_key` = '".wpsg_q($meta_key)."' AND `target_id` = '".wpsg_q($this->id)."' ");
+
+            return $meta_value;
+
+        } // public function getMeta($meta_key)
+
 	} // class wpsg_model
Index: /model/wpsg_news.class.php
===================================================================
--- /model/wpsg_news.class.php	(revision 7703)
+++ /model/wpsg_news.class.php	(revision 7704)
@@ -34,5 +34,5 @@
 			else
 			{
-			
+
 				return $last_news;
 				
@@ -46,6 +46,16 @@
 		 */
 		public static function getLatestNewsFromRSS() {
-			
-			$xml = new SimpleXMLElement($GLOBALS['wpsg_sc']->get_url_content(self::$rss_url));
+
+		    try {
+
+		        $xml = new SimpleXMLElement($GLOBALS['wpsg_sc']->get_url_content(self::$rss_url));
+
+            } catch (\wpsg\Exception $e) {
+
+		        wpsg_ShopController::getShop()->addBackendError(__('Konnte News nicht laden.', 'wpsg'));
+
+		        return [];
+
+            }
 			
 			$result = $xml->xpath('//item');
Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 7703)
+++ /model/wpsg_order.class.php	(revision 7704)
@@ -4,6 +4,7 @@
 	 * Model fÃŒr eine Bestellung
 	 */
-	class wpsg_order extends wpsg_model
-	{
+	class wpsg_order extends wpsg_model {
+
+        static $_tableName = 'WPSG_TBL_ORDER';
 
 		/** @var bool wpsg_customer */
@@ -182,57 +183,4 @@
 			
 		} // public function getLastLogEntry()
-		
-		/**
-		 * Setzt einen Wert in der META Tabelle 
-		 */
-		public function setMeta($meta_key, $meta_value) {
-			
-			$target_id = $this->id;
-			
-			if (!wpsg_isSizedInt($target_id)) return;
-			
-			if (is_null($meta_value)) {
-				
-				$this->db->Query("DELETE FROM `".WPSG_TBL_META."` WHERE `meta_key` = '".wpsg_q($meta_key)."' AND `target_id` = '".wpsg_q($this->id)."' AND `meta_table` = 'WPSG_TBL_ORDER' ");
-				
-			} else {
-			
-				$nExistsID = $this->db->fetchOne("SELECT M.`id` FROM `".WPSG_TBL_META."` AS M WHERE M.`meta_table` = 'WPSG_TBL_ORDER' 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),
-						'meta_table' => "WPSG_TBL_ORDER",
-						'meta_key' => wpsg_q($meta_key),
-						'meta_value' => wpsg_q($meta_value)
-					));
-					
-				}
-				
-			}
-			
-		} // public function setMeta($meta_key, $meta_value)
-		
-		/**
-		 * Gibt einen META Value zurÃŒck
-		 */
-		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_ORDER' AND M.`meta_key` = '".wpsg_q($meta_key)."' AND `target_id` = '".wpsg_q($this->id)."' ");
-			
-			return $meta_value;
-			
-		} // public function getMeta($meta_key)
 
 		public function getPaymentTaxAmount()
@@ -437,5 +385,5 @@
 			
 			$order_payment_key = $this->__get('payment_key');
-			if (!wpsg_isSizedString($shipping_key) && wpsg_isSizedString($this->__get('type_payment'))) $order_payment_key = $this->__get('type_payment');
+			if (!wpsg_isSizedString($order_payment_key) && wpsg_isSizedString($this->__get('type_payment'))) $order_payment_key = $this->__get('type_payment');
 			
 			return $order_payment_key; 
@@ -448,7 +396,7 @@
 		public function getPaymentLabel() {
 			
-			$order_payment_ke = $this->getPaymentID();
-			
-			if (!array_key_exists($this->getPaymentID(), $this->shop->arPayment)) return wpsg_translate(__('Deaktivierte Zahlungsart (#1#)', 'wpsg'), $this->getPaymentID());
+			$order_payment_key = $this->getPaymentID();
+			
+			if (!array_key_exists($order_payment_key, $this->shop->arPayment)) return wpsg_translate(__('Deaktivierte Zahlungsart (#1#)', 'wpsg'), $this->getPaymentID());
 			else return $this->shop->arPayment[$this->getPaymentID()]['name'];
 
@@ -494,5 +442,5 @@
 			
 			$order_shipping_key = $this->__get('shipping_key');
-			if (!wpsg_isSizedString($shipping_key) && wpsg_isSizedString($this->__get('type_shipping'))) $order_shipping_key = $this->__get('type_shipping');
+			if (!wpsg_isSizedString($order_shipping_key) && wpsg_isSizedString($this->__get('type_shipping'))) $order_shipping_key = $this->__get('type_shipping');
 			
 			return $order_shipping_key;
@@ -1578,4 +1526,2 @@
 		
 	} // class wpsg_mod_order extends wpsg_model
- 
-?>
Index: /model/wpsg_order_product.class.php
===================================================================
--- /model/wpsg_order_product.class.php	(revision 7703)
+++ /model/wpsg_order_product.class.php	(revision 7704)
@@ -4,9 +4,10 @@
 	 * Klasse, die ein bestelltes Produkt behandelt
 	 */
-	class wpsg_order_product extends wpsg_model
-	{
+	class wpsg_order_product extends wpsg_model {
+
+        static $_tableName = 'WPSG_TBL_ORDERPRODUCT';
 
 		public $number;
-						
+
 		/**
 		 * LÃ€dt die Daten des bestellten Produkts
@@ -171,4 +172,2 @@
 		
 	} // class wpsg_order_product extends wpsg_model
-
-?>
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 7703)
+++ /model/wpsg_product.class.php	(revision 7704)
@@ -4,6 +4,7 @@
 	 * Klasse, die ein Produkt behandelt
 	 */
-	class wpsg_product extends wpsg_model
-	{
+	class wpsg_product extends wpsg_model {
+
+	    static $_tableName = 'WPSG_TBL_PRODUCTS';
 
 		const MULTIPLE_ONE_MULTI = 0; // Nur einmal mit beliebiger Menge (Standard)
@@ -117,50 +118,4 @@
 		} // public function getProductKey()
 
-		/**
-		 * Setzt einen Wert in der META Tabelle
-		 */
-		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),
-					'meta_table' => "WPSG_TBL_PRODUCTS",
-					'meta_key' => wpsg_q($meta_key),
-					'meta_value' => wpsg_q($meta_value)
-				));
-
-			}
-
-		} // public function setMeta($meta_key, $meta_value)
-
-		/**
-		 * Gibt einen META Value zurÃŒck
-		 */
-		public function getMeta($meta_key) {
-
-			if ($this->arMeta === null) {
-				
-				$this->arMeta = $this->db->fetchAssocField("SELECT M.`meta_key`, M.`meta_value` FROM `".WPSG_TBL_META."` AS M WHERE M.`meta_table` = 'WPSG_TBL_PRODUCTS' AND M.`target_id` = '".wpsg_q($this->id)."' ", "meta_key", "meta_value");
-				 				
-			}
-			
-			if (isset($meta_key, $this->arMeta)) return $this->arMeta[$meta_key];
-			else return '';
-
-		} // public function getMeta($meta_key)
-		
 		/**
 		 * @return wpsg_productgroup
@@ -1059,4 +1014,2 @@
 
 	} // class wpsg_product extends wpsg_model
-
-?>
Index: /mods/mod_gutschein/wpsg_voucher.php
===================================================================
--- /mods/mod_gutschein/wpsg_voucher.php	(revision 7703)
+++ /mods/mod_gutschein/wpsg_voucher.php	(revision 7704)
@@ -44,6 +44,8 @@
 		
 		public function isMultiUsable() {
-			
-			return wpsg_isSizedInt($this->multi);
+
+		    $multi = $this->multi;
+
+			return wpsg_isSizedInt($multi);
 			
 		}
@@ -73,5 +75,5 @@
         public function isCoupon() {
 			
-			return wpsg_isSizedInt($this->__get('coupon'));
+			return intval($this->__get('coupon')) > 0;
 			
 		}
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 7703)
+++ /mods/wpsg_mod_basic.class.php	(revision 7704)
@@ -213,4 +213,6 @@
 		
 		public function calculation_saveProduct(&$oCalculation, $calc_product, &$db_product_data, $finish_order) { }
+
+        public function calculation_saveProduct_after(&$oCalculation, $calc_product, &$db_product_data, $finish_order) { }
 	
 		/** @var \wpsg\wpsg_calculation $oCalculation */
@@ -383,4 +385,6 @@
 		public function order_view($order_id, &$arSidebarArray) { }
 
+		public function order_view_row_before(&$p, $i) { }
+
 		/** Wird bei der Darstellung einer Produktzeile in der Bestellverwaltung aufgerufen */
 		public function order_view_row(&$p, $i) { }
@@ -489,5 +493,8 @@
 		/** Wird von der Basket Klasse beim erstellen des Array kurz vor den Versand / Zahlungsarten aufgerufen */
 		public function basket_toArray_preshippayment(&$basket, &$arBasket) { }
-		
+
+		/** Zeile im Warenkorb vor dem Einzelpreis */
+        public function basket_row_before(&$p, $i) { }
+
 		/**
 		 * Wird nach dem Rendern des Produktes im Basket aufgerufen (aus basket.phtml)
@@ -513,5 +520,8 @@
 		/** Wird im Checkout2 (checkout2.phtml) innerhalb des Formulars vor den Buttons aufgerufen */
 		public function checkout2_inner_prebutton(&$checkout_view) { }
-		
+
+		/** Wird im Overview vor dem Einzelpreis aufgerufen */
+		public function overview_row_before(&$p, $i) { }
+
 		/**
 		 * Wird bei der Zusammenfassung der Bestellung aufgerufen (overview.phtml)
@@ -536,5 +546,5 @@
 		 */
 		public function checkBasket(&$error) { }
-		
+
 		/** Wird von der wpsg_basket Klasse beim prÃŒfen des Checkouts aufgerufen */
 		public function checkCheckout(&$state, &$error, &$arCheckout) { }
Index: /mods/wpsg_mod_coverletter.class.php
===================================================================
--- /mods/wpsg_mod_coverletter.class.php	(revision 7703)
+++ /mods/wpsg_mod_coverletter.class.php	(revision 7704)
@@ -10,4 +10,5 @@
 		var $id = 2200;
 		var $hilfeURL = 'http://wpshopgermany.maennchen1.de/?p=3667';
+        var $version = "9.9.9";
 		
 		public function __construct() {
Index: /mods/wpsg_mod_customerbudget.class.php
===================================================================
--- /mods/wpsg_mod_customerbudget.class.php	(revision 7703)
+++ /mods/wpsg_mod_customerbudget.class.php	(revision 7704)
@@ -9,4 +9,5 @@
 		var $lizenz = 1;
 		var $id = 1001;
+        var $version = "9.9.9";
 		
 		/**
Index: /mods/wpsg_mod_paypalapi.class.php
===================================================================
--- /mods/wpsg_mod_paypalapi.class.php	(revision 7703)
+++ /mods/wpsg_mod_paypalapi.class.php	(revision 7704)
@@ -35,6 +35,7 @@
 		} // public function __construct()
 				
-		public function init() 
-		{ 
+		public function init() {
+
+            spl_autoload_register(array($this, 'spl_autoload'));
 		
 			// Wenn WÃ€hrungscode in den Einstellungen gesetzt ist dann diesen nehmen, sonst bleibt alles wie bisher bei EUR
@@ -63,6 +64,14 @@
 		} // public function install()
 		
-		public function settings_edit()
-		{
+		public function settings_edit() {
+
+            /*
+		    $oOrder = wpsg_order::getInstance(8);
+		    $wpsg_basket = new wpsg_basket();
+		    $wpsg_basket->initFromDB(8);
+		    $arBasket = $wpsg_basket->toArray();
+		    $this->api_startPayment_v2($arBasket, 8, false);
+		    die();
+            */
 			
 			$pages = get_pages();
@@ -346,6 +355,5 @@
 						$this->shop->callMod('wpsg_mod_willcollect', 'checkCheckout', array(&$step, &$error, &$arCheckout));
 					
-						if ($error === true)
-						{
+						if ($error === true) {
 							
 							$this->shop->view['wpsg_mod_paypalapi']['error'] = __('Die Zahlungsart PayPal ist leider nicht mit der Versandart "Selbstabholung" mÃ¶glich. Ihre Zahlung wurde storniert und ihr Konto nicht belastet. Bitte wÃ€hlen Sie eine andere Zahlungsart aus.', 'wpsg');
@@ -444,6 +452,8 @@
 
 			if (!wpsg_checkInput($_REQUEST['edit_id'], WPSG_SANITIZE_INT)) throw \wpsg\Exception::getSanitizeException(); else $order_id = $_REQUEST['edit_id'];
- 			if (!wpsg_checkInput($_REQUEST['do'], WPSG_SANITIZE_VALUES, ['refund', 'refresh'])) throw \wpsg\Exception::getSanitizeException(); else $do = $_REQUEST['do'];			
-			
+ 			if (!wpsg_checkInput($_REQUEST['do'], WPSG_SANITIZE_VALUES, ['refund', 'refresh'])) throw \wpsg\Exception::getSanitizeException(); else $do = $_REQUEST['do'];
+
+            $oOrder = wpsg_order::getInstance(intval($order_id));
+
 			if ($do === 'refund') {
 			
@@ -458,13 +468,28 @@
 			
 			} else if ($do === 'refresh') {
-				
-				list($payment_state, $sale_state) = $this->getState($_REQUEST['edit_id']);
-				
-				if (!wpsg_isSizedString($payment_state)) $this->shop->addBackendError(__('Status der Zahlung konnte nicht abgefragt werden.', 'wpsg'));
-				else $this->shop->addBackendMessage(wpsg_translate(__('Status der Zahlung (#1#) erfolgreich abgefragt.', 'wpsg'), $payment_state.'/'.$sale_state));
-				
-				$this->shop->redirect(
-					wpsg_admin_url('Order', 'view', ['edit_id' => $order_id])
-				);
+
+			    try {
+
+			        $state = $this->getState($order_id);
+
+                } catch (\Exception $e) { }
+
+				if (is_array($state)) {
+
+                    list($payment_state, $sale_state, $result) = $state;
+
+                    $oOrder->addLogEntry('PayPal Status', print_r($result, true));
+
+                    $this->shop->addBackendMessage(wpsg_translate(__('Status der Zahlung (#1#) erfolgreich abgefragt.', 'wpsg'), $payment_state.'/'.$sale_state));
+
+                    $this->shop->redirect(
+                        wpsg_admin_url('Order', 'view', ['edit_id' => $order_id])
+                    );
+
+                } else {
+
+                    $this->shop->addBackendError(__('Status der Zahlung konnte nicht abgefragt werden.', 'wpsg'));
+
+                }
 				
 			}
@@ -484,10 +509,10 @@
 			
 			$wpsg_mod_paypalapi_paymentId = $oOrder->getMeta('wpsg_mod_paypalapi_paymentId');
-			
+
 			if (wpsg_isSizedString($wpsg_mod_paypalapi_paymentId)) {
-				
-				$payment_info = $this->api_getPaymentInfo($oOrder->getMeta('wpsg_mod_paypalapi_paymentId'), true);
-	 
-				$amount_approved = floatval($payment_info['transactions'][0]['amount']['total']);
+
+				$payment_info = $this->api_getPaymentInfo_v2($wpsg_mod_paypalapi_paymentId, true);
+
+				$amount_approved = floatval($payment_info['purchase_units'][0]['amount']['value']);
 				 
 				//if ($amount_approved === floatval($oOrder->getAmount()) && !wpsg_isSizedString($oOrder->getMeta('wpsg_mod_paypalapi_saleid')))
@@ -495,52 +520,52 @@
 				
 				$wpsg_mod_paypalapi_saleid = $oOrder->getMeta('wpsg_mod_paypalapi_saleid');
-				
-				if ($amount_approved === floatval($oOrder->getAmount()) && !wpsg_isSizedString($wpsg_mod_paypalapi_saleid))
-				{
-					
-					$this->api_try = true;
-					$payment_info_execute = $this->api_executePayment($oOrder->getMeta('wpsg_mod_paypalapi_paymentId'), $oOrder->getMeta('wpsg_mod_paypalapi_payer_id'));
-					$this->api_try = false; 
-					
-					if (wpsg_isSizedString($payment_info_execute['transactions'][0]['related_resources'][0]['sale']['id']))
-					{
-					
-						$sale_id = $payment_info_execute['transactions'][0]['related_resources'][0]['sale']['id'];
-									
-						$oOrder->setMeta('wpsg_mod_paypalapi_saleid', $sale_id);
-						$oOrder->setMeta('wpsg_mod_paypalapi_salestate', $payment_info_execute['transactions'][0]['related_resources'][0]['sale']['state']);
-						$oOrder->setMeta('wpsg_mod_paypalapi_paymentstate', $payment_info_execute['state']);
-					
-						if ($payment_info_execute['state'] == 'approved')
-						{
-								
-							$this->shop->view['wpsg_mod_paypalapi']['done'] = '2';
-							$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_paypalapi/order_done.phtml');
-							
-							return;
-							
-						}
-						
-						else $payment_info = $payment_info_execute;
-						
-					}
+
+				if ($amount_approved === floatval($oOrder->getAmount()) && !wpsg_isSizedString($wpsg_mod_paypalapi_saleid)) {
+
+				    try {
+
+				        $payment_info_execute = $this->api_executePayment_v2($oOrder->getMeta('wpsg_mod_paypalapi_paymentId'), $oOrder->getMeta('wpsg_mod_paypalapi_payer_id'));
+
+                        if (wpsg_isSizedString($payment_info_execute['purchase_units'][0]['payments']['captures'][0]['id'])) {
+
+                            $sale_id = $payment_info_execute['purchase_units'][0]['payments']['captures'][0]['id'];
+
+                            $oOrder->setMeta('wpsg_mod_paypalapi_saleid', $sale_id);
+                            $oOrder->setMeta('wpsg_mod_paypalapi_salestate', $payment_info_execute['purchase_units'][0]['payments']['captures'][0]['status']);
+                            $oOrder->setMeta('wpsg_mod_paypalapi_paymentstate', $payment_info_execute['status']);
+
+                            if ($payment_info_execute['status'] === 'COMPLETED') {
+
+                                $this->shop->view['wpsg_mod_paypalapi']['done'] = '2';
+                                $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_paypalapi/order_done.phtml');
+
+                                return;
+
+                            }
+                            else $payment_info = $payment_info_execute;
+
+                        }
+
+                    } catch (\Exception $e) {
+
+				        wpsg_debug($e->getMessage());
+				        // ...
+
+                    }
 					
 				}
 												
 			}
-		 
- 			if ($payment_info['state'] == 'approved')
-			{
+
+ 			if (isset($payment_info['status']) && $payment_info['status'] == 'COMPLETED') {
 			
 				$this->shop->view['wpsg_mod_paypalapi']['done'] = '1';				
 				
-			}
-			else
-			{
-				
-				$json_data = $this->api_startPayment($done_view['basket'], $order_id);
+			} else {
+				
+				$json_data = $this->api_startPayment_v2($done_view['basket'], $order_id);
 
 				$approval_url = "";
-				foreach ($json_data['links'] as $k => $l) if ($l['rel'] == 'approval_url') $approval_url = $l['href'];
+				foreach ($json_data['links'] as $k => $l) if ($l['rel'] == 'approve') $approval_url = $l['href'];
 				
 				$this->shop->view['wpsg_mod_paypalapi']['approval_url'] = $approval_url;
@@ -705,5 +730,5 @@
 			if ($oOrder === false) die(__('Keine Bestellung zu PaymentID gefunden.', 'wpsg'));
 			
-			list($payment_state, $sale_state) = $this->getState($order_id);
+			list($payment_state, $sale_state, $result) = $this->getState($order_id);
 			$orderPaymentID = $oOrder->getMeta('wpsg_mod_paypalapi_paymentid');
 			
@@ -733,8 +758,8 @@
 			$order_id = $_SESSION['wpsg']['order_id'];
 						
-			$json_data = $this->api_startPayment($this->shop->basket->toArray(), $order_id);
-			
+			$json_data = $this->api_startPayment_v2($this->shop->basket->toArray(), $order_id);
+
 			$approval_url = false;
-			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approval_url') $approval_url = $l['href']; }
+			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approve') $approval_url = $l['href']; }
   
 			$this->shop->redirect($approval_url);
@@ -745,23 +770,19 @@
 		 * Wird aufgerufen wenn der Kunde von PayPal zurÃŒck zum Shop kommt
 		 */
-		public function returnPayPalExpressRedirect()
-		{
-
-			$_REQUEST['paymentId'] = wpsg_sinput("key", $_REQUEST['paymentId']);
-			$_REQUEST['PayerID'] = wpsg_sinput("key", $_REQUEST['PayerID']);
-
-			$json_data = $this->api_getPaymentInfo($_REQUEST['paymentId']);
+		public function returnPayPalExpressRedirect() {
+
+            $_REQUEST['paymentId'] = sanitize_text_field($_REQUEST['token']);
+
+			$json_data = $this->api_getPaymentInfo_v2($_REQUEST['paymentId']);
 
 			$order_id = $this->db->fetchOne("SELECT `target_id` FROM `".WPSG_TBL_META."` WHERE `meta_table` = 'WPSG_TBL_ORDER' AND `meta_key` = 'wpsg_mod_paypalapi_paymentid' AND `meta_value` = '".wpsg_q($_REQUEST['paymentId'])."' ");
 			
-			if (wpsg_isSizedInt($order_id))
-			{
+			if (wpsg_isSizedInt($order_id)) {
 				
 				$oOrder = wpsg_order::getInstance($order_id);
 				
-				if ($oOrder !== false && $oOrder->status != wpsg_ShopController::STATUS_UNVOLLSTAENDIG)
-				{
-						
-					$json_data = $this->api_executePayment($_REQUEST['paymentId'], $_REQUEST['PayerID']);
+				if ($oOrder !== false && $oOrder->status != wpsg_ShopController::STATUS_UNVOLLSTAENDIG) {
+						
+					$json_data = $this->api_executePayment_v2($_REQUEST['paymentId'], $_REQUEST['PayerID']);
 					
 					$this->getState($oOrder->id);
@@ -786,45 +807,37 @@
             // https://stackoverflow.com/questions/44968561/how-to-get-billing-address-in-getexpresscheckoutdetails-api-nvp
 
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['vname'])) $_SESSION['wpsg']['checkout']['vname'] = $json_data['payer']['payer_info']['first_name'];
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['name'])) $_SESSION['wpsg']['checkout']['name'] = $json_data['payer']['payer_info']['last_name'];
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['email'])) 
-			{
-				$_SESSION['wpsg']['checkout']['email'] = $json_data['payer']['payer_info']['email'];
-				$_SESSION['wpsg']['checkout']['email2'] = $json_data['payer']['payer_info']['email'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['vname']) && isset($json_data['payer']['name']['given_name'])) $_SESSION['wpsg']['checkout']['vname'] = $json_data['payer']['name']['given_name'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['name']) && isset($json_data['payer']['name']['surname'])) $_SESSION['wpsg']['checkout']['name'] = $json_data['payer']['name']['surname'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['email']) && isset($json_data['payer']['email_address'])) {
+				$_SESSION['wpsg']['checkout']['email'] = $json_data['payer']['email_address'];
+				$_SESSION['wpsg']['checkout']['email2'] = $json_data['payer']['email_address'];
 			}				
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['tel'])) $_SESSION['wpsg']['checkout']['tel'] = $json_data['payer']['payer_info']['phone'];
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['strasse'])) $_SESSION['wpsg']['checkout']['strasse'] =  $json_data['payer']['payer_info']['shipping_address']['line1'];
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['ort'])) $_SESSION['wpsg']['checkout']['ort'] = $json_data['payer']['payer_info']['shipping_address']['city'];
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['plz'])) $_SESSION['wpsg']['checkout']['plz'] = $json_data['payer']['payer_info']['shipping_address']['postal_code'];
-			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['land'])) $_SESSION['wpsg']['checkout']['land'] = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_LAND."` WHERE UPPER(`kuerzel`) = '".wpsg_q(strtoupper($json_data['payer']['payer_info']['shipping_address']['country_code']))."'");
-			
-			/*
-			 * // Es gab Probleme, dass die Lieferadresse von Paypal ÃŒbernommen wurde. Dies fÃŒhrte zu Verwirrung da dadurch das Land in unglÃŒcklichem Beispiel gewechselt hat
-			 * //02.06.2016
-			if (wpsg_isSizedArray(wpsg_trim($json_data['payer']['payer_info']['shipping_address'])) && $this->shop->hasMod('wpsg_mod_shippingadress'))
-			{
-				 
-				if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping_plz'])) $_SESSION['wpsg']['checkout']['shipping_plz'] = $json_data['payer']['payer_info']['shipping_address']['postal_code'];
-				if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping_vname']) || !wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping_name'])) 
-				{
-					
-					$arName = explode(' ', $json_data['payer']['payer_info']['shipping_address']['recipient_name']);
-					
-					if (sizeof($arName) > 1) $_SESSION['wpsg']['checkout']['shipping_vname'] = $arName[0]; else $_SESSION['wpsg']['checkout']['shipping_vname'] = '';					
-					if (sizeof($arName) > 1) $_SESSION['wpsg']['checkout']['shipping_name'] = implode(' ', array_slice($arName, 1)); else $_SESSION['wpsg']['checkout']['shipping_name'] = implode(' ', $arName);
-					
-				}
-				if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping_strasse'])) $_SESSION['wpsg']['checkout']['shipping_strasse'] = $json_data['payer']['payer_info']['shipping_address']['line1'];
-				if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping_ort'])) $_SESSION['wpsg']['checkout']['shipping_ort'] = $json_data['payer']['payer_info']['shipping_address']['city'];
-				if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['shipping_land'])) $_SESSION['wpsg']['checkout']['shipping_land'] = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_LAND."` WHERE UPPER(`kuerzel`) = '".wpsg_q(strtoupper($json_data['payer']['payer_info']['shipping_address']['country_code']))."'");
-				 
-				$_SESSION['wpsg']['checkout']['diff_shippingadress'] = '1';
-									
-			}
-			*/
-						
-			$_SESSION['wpsg']['checkout']['payment_amount'] = $json_data['transactions'][0]['amount']['total'];			
-			$_SESSION['wpsg']['checkout']['paymentId'] = $_REQUEST['paymentId'];
-			$_SESSION['wpsg']['checkout']['payer_id'] = $json_data['payer']['payer_info']['payer_id'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['tel']) && isset($json_data['payer']['phone'])) $_SESSION['wpsg']['checkout']['tel'] = $json_data['payer']['phone'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['strasse']) && isset($json_data['payer']['address']['address_line_1'])) $_SESSION['wpsg']['checkout']['strasse'] =  $json_data['payer']['address']['address_line_1'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['ort']) && isset($json_data['payer']['address']['admin_area_2'])) $_SESSION['wpsg']['checkout']['ort'] = $json_data['payer']['address']['admin_area_2'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['plz']) && isset($json_data['payer']['address']['postal_code'])) $_SESSION['wpsg']['checkout']['plz'] = $json_data['payer']['address']['postal_code'];
+			if (!wpsg_isSizedString($_SESSION['wpsg']['checkout']['land']) && isset($json_data['payer']['address']['country_code'])) $_SESSION['wpsg']['checkout']['land'] = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_LAND."` WHERE UPPER(`kuerzel`) = '".wpsg_q(strtoupper($json_data['payer']['address']['country_code']))."'");
+
+			if ($this->shop->hasMod('wpsg_mod_shippingadress') && !isset($_SESSION['wpsg']['checkout']['diff_shippingadress'])) {
+
+			    if (isset($json_data['purchase_units'][0]['shipping'])) {
+
+                    $_SESSION['wpsg']['checkout']['diff_shippingadress'] = '1';
+
+                    $_SESSION['wpsg']['checkout']['shipping_vname'] = wpsg_getStr($json_data['purchase_units'][0]['shipping']['name']['given_name']);
+                    $_SESSION['wpsg']['checkout']['shipping_name'] = wpsg_getStr($json_data['purchase_units'][0]['shipping']['name']['full_name']);
+
+                    $_SESSION['wpsg']['checkout']['shipping_strasse'] = wpsg_getStr($json_data['purchase_units'][0]['shipping']['address_line_1']);
+                    $_SESSION['wpsg']['checkout']['shipping_plz'] = wpsg_getStr($json_data['purchase_units'][0]['shipping']['postal_code']);
+                    $_SESSION['wpsg']['checkout']['shipping_ort'] = wpsg_getStr($json_data['purchase_units'][0]['shipping']['admin_area_2']);
+                    $_SESSION['wpsg']['checkout']['shipping_land'] = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_LAND."` WHERE UPPER(`kuerzel`) = '".wpsg_q(strtoupper(wpsg_getStr($json_data['purchase_units'][0]['shipping']['country_code'])))."'");
+
+                }
+
+            }
+
+			$_SESSION['wpsg']['checkout']['payment_amount'] = $json_data['purchase_units'][0]['amount']['value'];
+			$_SESSION['wpsg']['checkout']['paymentId'] = $json_data['id'];
+			$_SESSION['wpsg']['checkout']['payer_id'] = $json_data['payer']['payer_id'];
 			
 			$this->shop->basket->initFromSession(true);
@@ -836,18 +849,13 @@
 			$check2 = $checkCheckout = $this->shop->basket->checkCheckout(2);
 			
-			if ($check1 === false)
-			{
+			if ($check1 === false) {
 					
 				$this->shop->redirect($this->shop->getUrl(wpsg_ShopController::URL_CHECKOUT));
 					
-			}
-			else if ($check2 === false)
-			{
+			} else if ($check2 === false) {
 					
 				$this->shop->redirect($this->shop->getUrl(wpsg_ShopController::URL_CHECKOUT2));
 					
-			}
-			else
-			{
+			} else {
 			
 				$this->shop->addFrontendMessage(__('Ihre Daten wurden von PayPal ÃŒbernommen und Sie kÃ¶nnen die Bestellung direkt abschlieÃen, nachdem Sie alles ÃŒberprÃŒft haben.', 'wpsg'));
@@ -890,11 +898,12 @@
 		 * Definiert Variablen fÃŒr das View welches den IFrame einbindet
 		 */
-		private function setViewForPayPalPLus() 
-		{
-			
-			$json_data = $this->api_startPayment($this->shop->view['basket'], $_SESSION['wpsg']['order_id'], false);
-			
+		private function setViewForPayPalPLus() {
+			
+			$json_data = $this->api_startPayment_v2($this->shop->view['basket'], $_SESSION['wpsg']['order_id'], false);
+
+			//wpsg_debug($json_data);
+
 			$approval_url = false;
-			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approval_url') $approval_url = $l['href']; }
+			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approve') $approval_url = $l['href']; }
 			
 			// Das war mal drin mir ist nicht klar warum:
@@ -994,27 +1003,30 @@
 		 * Gibt den PaymentState und SaleState zurÃŒck
 		 */
-		public function getState($order_id)
-		{
+		public function getState($order_id) {
 												
 			$oOrder = wpsg_order::getInstance($order_id);
-			
-			if (!wpsg_isSizedString($oOrder->getMeta('wpsg_mod_paypalapi_paymentid'))) return false;
-			
-			$payment_info = $this->api_getPaymentInfo($oOrder->getMeta('wpsg_mod_paypalapi_paymentid'));
-			
-			$payment_state = $payment_info['state'];
-			$sale_state = $payment_info['transactions'][0]['related_resources'][0]['sale']['state'];
- 
-			if (!wpsg_isSizedString($payment_state)) return false;
-			
-			if (wpsg_isSizedString($payment_state)) $oOrder->setMeta('wpsg_mod_paypalapi_paymentstate', $payment_state);
-			if (wpsg_isSizedString($sale_state)) $oOrder->setMeta('wpsg_mod_paypalapi_salestate', $sale_state);
-									
-			return array($payment_state, $sale_state); 
+
+			$paymentID = $oOrder->getMeta('wpsg_mod_paypalapi_paymentid');
+
+			if (!wpsg_isSizedString($paymentID)) return false;
+			else {
+
+                $payment_info = $this->api_getPaymentInfo_v2($paymentID);
+
+                $payment_state = wpsg_getStr($payment_info['status']);
+                $sale_state = wpsg_getStr($payment_info['purchase_units'][0]['payments']['captures'][0]['status'], __('Unbekannt', 'wpsg'));
+
+                if (!wpsg_isSizedString($payment_state)) return false;
+
+                if (wpsg_isSizedString($payment_state)) $oOrder->setMeta('wpsg_mod_paypalapi_paymentstate', $payment_state);
+                if (wpsg_isSizedString($sale_state)) $oOrder->setMeta('wpsg_mod_paypalapi_salestate', $sale_state);
+
+                return array($payment_state, $sale_state, $payment_info);
+
+            }
 			
 		} // public function getState($order_id)
 		
-		public function stornoOrder($order_id)
-		{
+		public function stornoOrder($order_id) {
 			
 			$oOrder = wpsg_order::getInstance($order_id);
@@ -1023,5 +1035,5 @@
 			$sale_id = $oOrder->getMeta('wpsg_mod_paypalapi_saleid');
 			
-			$json_data = $this->api_refundSale($sale_id, $oOrder->getAmount());
+			$json_data = $this->api_refundSale_v2($sale_id, $oOrder->getAmount());
 			
 			$this->getState($oOrder->id);			
@@ -1030,5 +1042,5 @@
 			
 		} // public function stornoOrder($order_id)
-		
+
 		/**
 		 * Gibt true/false zurÃŒck ob die Api auf die PayPal Sandbox zurÃŒckgreift
@@ -1054,7 +1066,14 @@
 		
 		/* Neu ohne PHPApi */
-			
-		private function api_refundSale($sale_id, $amount)
-		{
+
+        /**
+         * DEPRECATED
+         * @param $sale_id
+         * @param $amount
+         * @return array|mixed|void
+         */
+		private function api_refundSale($sale_id, $amount) {
+
+		    throw new \Exception(__('Veraltet', 'wpsg'));
 			
 			$post_data = array(
@@ -1070,5 +1089,24 @@
 			
 		} // private function api_refundSale($sale_id)
-		
+
+        private function api_refundSale_v2($sale_id, $amount) {
+
+            $client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($this->api_getEnvironment());
+
+            $request = new \PayPalCheckoutSdk\Payments\CapturesRefundRequest($sale_id);
+            $request->body = [
+                'amount' => [
+                    'value' => number_format($amount, 2),
+                    'currency_code' => $this->currency
+                ]
+            ];
+
+            $json_data = $client->execute($request);
+            $json_data = json_decode(json_encode($json_data), true)['result'];
+
+            return $json_data;
+
+        }
+
 		/**
 		 * Erstellt einen neuen WebHook fÃŒr ZahlungseingÃ€nge auf der ÃŒbergebenene URL
@@ -1106,8 +1144,10 @@
 		
 		/**
+         * DEPRECATED
 		 * FÃŒhrt eine Zahlung aus
 		 */
-		private function api_executePayment($payment_id, $payer_id)
-		{
+		private function api_executePayment($payment_id, $payer_id) {
+
+		    throw new \Exception(__('Veraltet', 'wpsg'));
 			
 			$post_data = array(
@@ -1120,5 +1160,15 @@
 			
 		} // private function api_executePayment($payment_id, $payer_id, $order_id)
-		
+
+        private function api_executePayment_v2($payment_id, $payer_id) {
+
+            $client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($this->api_getEnvironment());
+            $json_data = $client->execute(new \PayPalCheckoutSdk\Orders\OrdersCaptureRequest($payment_id));
+            $json_data = json_decode(json_encode($json_data), true)['result'];
+
+            return $json_data;
+
+        }
+
 		/**
 		 * Aktualisiert eine Zahlungserfahrung
@@ -1184,5 +1234,248 @@
 			
 		} // private function api_getWebExperience()
-		
+
+        private function api_getEnvironment() {
+
+            if ($this->isSandbox()) {
+
+                $clientId = $this->shop->get_option('wpsg_mod_paypalapi_sandbox_clientid');
+                $clientSecret = $this->shop->get_option('wpsg_mod_paypalapi_sandbox_secret');
+
+                return new \PayPalCheckoutSdk\Core\SandboxEnvironment($clientId, $clientSecret);
+
+            } else {
+
+                $clientId = $this->shop->get_option('wpsg_mod_paypalapi_clientid');
+                $clientSecret = $this->shop->get_option('wpsg_mod_paypalapi_secret');
+
+                return new \PayPalCheckoutSdk\Core\ProductionEnvironment($clientId, $clientSecret);
+
+            }
+
+        }
+
+        /**
+         * @param $arBasket
+         * @param bool $order_id
+         * @param bool $express
+         * @throws \wpsg\Exception
+         */
+        private function api_startPayment_v2($arBasket, $order_id = false, $express = true) {
+
+            if (!wpsg_isSizedInt($order_id)) $order_id = $this->shop->basket->save(false, false, true);
+
+            $oOrder = wpsg_order::getInstance($order_id);
+
+            $client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($this->api_getEnvironment());
+
+            if ($oOrder->getId() > 0 && $oOrder->status == wpsg_ShopController::STATUS_UNVOLLSTAENDIG) {
+
+                $application_context = [
+                    'return_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'returnPayPalExpress'),
+                    'cancel_url' => $this->shop->getDoneURL($oOrder->id)
+                ];
+
+            } else {
+
+                $application_context = [
+                    'return_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'returnPayPalExpress'),
+                    'cancel_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET)
+                ];
+
+            }
+
+            $request = new \PayPalCheckoutSdk\Orders\OrdersCreateRequest();
+            $request->prefer('return=representation');
+            $request->body = [
+                "intent" => "CAPTURE",
+                'purchase_units' => [[
+                    'reference_id' => "order_".$order_id,
+                    'description' => $this->shop->replaceUniversalPlatzhalter(__($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_subject'), 'wpsg'), $order_id),
+                    'amount' => [
+                        'currency_code' => $this->currency,
+                        'value' => number_format($arBasket['sum']['preis_gesamt_brutto'], 2)
+                    ]
+                ]],
+                "application_context" => $application_context
+            ];
+
+            $subTotal = 0; $tax_total = 0; $item_total = 0; $discounts = 0;
+            $items = []; $breakdown = [];
+
+            foreach ($arBasket['produkte'] as $k => $p) {
+ 
+                $sku = $this->shop->getProductAnr($this->shop->getProduktID($p['id']));
+                if (!wpsg_isSizedString($sku)) $sku = __('n.A.', 'wpsg');
+
+                $tax = number_format($p['preis_brutto'] - $p['preis_netto'], 2);
+
+                $items[] = [
+                    'quantity' => $p['menge'],
+                    'name' => $this->shop->getProductName($this->shop->getProduktID($p['id']), true),
+                    'description' => '',
+                    'sku' => $sku,
+                    'unit_amount' => [
+                        'currency_code' => $this->currency,
+                        'value' => number_format($p['preis_netto'], 2)
+                    ],
+                    'tax' => [
+                        'currency_code' => $this->currency,
+                        'value' => $tax
+                    ]
+                ];
+
+                $item_total += $p['preis_netto'] * $p['menge'];
+                $subTotal += $p['preis_brutto'] * $p['menge'];
+                $tax_total += $tax * $p['menge'];
+
+            }
+
+            if (isset($arBasket['sum']['preis_shipping_brutto']) && $arBasket['sum']['preis_shipping_brutto'] > 0) {
+
+                $items[] = [
+                    'quantity' => 1,
+                    'name' => __('Versandkosten', 'wpsg'),
+                    'description' => '',
+                    'sku' => '',
+                    'unit_amount' => [
+                        'currency_code' => $this->currency,
+                        'value' => number_format($arBasket['sum']['preis_shipping_netto'], 2)
+                    ],
+                    'tax' => [
+                        'currency_code' => $this->currency,
+                        'value' => number_format($arBasket['sum']['preis_shipping_brutto'] - $arBasket['sum']['preis_shipping_netto'], 2)
+                    ]
+                ];
+
+                $item_total += $arBasket['sum']['preis_shipping_netto'];
+                $subTotal += $arBasket['sum']['preis_shipping_brutto'];
+                $tax_total += ($arBasket['sum']['preis_shipping_brutto'] - $arBasket['sum']['preis_shipping_netto']);
+
+            }
+
+            if (isset($arBasket['sum']['preis_payment_brutto']) && $arBasket['sum']['preis_payment_brutto'] > 0) {
+
+                $items[] = [
+                    'quantity' => 1,
+                    'name' => __('Kosten fÃŒr Zahlungsart', 'wpsg'),
+                    'description' => '',
+                    'sku' => '',
+                    'unit_amount' => [
+                        'currency_code' => $this->currency,
+                        'value' => number_format($arBasket['sum']['preis_payment_netto'], 2)
+                    ],
+                    'tax' => [
+                        'currency_code' => $this->currency,
+                        'value' => number_format($arBasket['sum']['preis_payment_brutto'] - $arBasket['sum']['preis_payment_netto'], 2)
+                    ]
+                ];
+
+                $item_total += $arBasket['sum']['preis_payment_netto'];
+                $subTotal += $arBasket['sum']['preis_payment_brutto'];
+                $tax_total += ($arBasket['sum']['preis_payment_brutto'] - $arBasket['sum']['preis_payment_netto']);
+
+            }
+
+            if (isset($arBasket['arCalculation']['voucher'])) {
+
+                foreach ($arBasket['arCalculation']['voucher'] as $v) {
+
+                    $subTotal += $v['brutto'];
+
+                    $discounts += abs($v['brutto']);
+
+                }
+
+            }
+
+            if (isset($arBasket['arCalculation']['discount'])) {
+
+                foreach ($arBasket['arCalculation']['discount'] as $d) {
+
+                    $subTotal += $d['brutto'];
+
+                    $discounts += abs($d['brutto']);
+
+                }
+
+            }
+
+            // amount/value
+            // Should equal item_total + tax_total + shipping + handling + insurance - shipping_discount - discount.
+
+            //wpsg_debug($arBasket);
+            //wpsg_debug(floatval($subTotal).'==='.floatval($arBasket['sum']['preis_gesamt_brutto']));
+
+            if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_details')) && floatval($subTotal) === floatval($arBasket['sum']['preis_gesamt_brutto'])) {
+
+                $request->body['purchase_units'][0]['items'] = $items;
+
+                $request->body['purchase_units'][0]['amount']['breakdown'] = [
+                    'item_total' => [
+                        'currency_code' => $this->currency,
+                        'value' => 0
+                    ],
+                    'tax_total' => [
+                        'currency_code' => $this->currency,
+                        'value' => 0
+                    ],
+                    'shipping' => [
+                        'currency_code' => $this->currency,
+                        'value' => 0
+                    ],
+                    'handling' => [
+                        'currency_code' => $this->currency,
+                        'value' => 0
+                    ],
+                    'insurance' => [
+                        'currency_code' => $this->currency,
+                        'value' => 0
+                    ],
+                    'shipping_discount' => [
+                        'currency_code' => $this->currency,
+                        'value' => 0
+                    ],
+                    'discount' => [
+                        'currency_code' => $this->currency,
+                        'value' => 0
+                    ]
+                ];
+
+                $request->body['purchase_units'][0]['amount']['breakdown']['item_total']['value'] =
+                    number_format($item_total, 2);
+
+                $request->body['purchase_units'][0]['amount']['breakdown']['tax_total']['value'] =
+                    number_format($tax_total, 2);
+
+                $request->body['purchase_units'][0]['amount']['breakdown']['discount']['value'] =
+                    number_format($discounts, 2);
+
+            }
+
+            //wpsg_debug($request->body);
+
+            try {
+
+                $response = $client->execute($request);
+                $response = json_decode(json_encode($response), true)['result'];
+
+                if (wpsg_isSizedString($response['id'])) $oOrder->setMeta('wpsg_mod_paypalapi_paymentId', $response['id']);
+
+                //echo '<pre>'.print_r($response, true).'</pre>';
+
+                return $response;
+
+            } catch (Exception $ex) {
+
+                wpsg_debug(json_decode($ex->getMessage(), true));
+
+                throw new \wpsg\Exception($ex->getMessage());
+
+            }
+
+            die("-");
+
+        }
+
 		/**
 		 * Authorisiert eine Zahlung
@@ -1191,6 +1484,7 @@
 		 * 
 		 */
-		private function api_startPayment($arBasket, $order_id = false, $express = true)
-		{
+		private function api_startPayment($arBasket, $order_id = false, $express = true) {
+
+		    throw new \Exception("Veraltet");
 						
 			$oOrder = wpsg_order::getInstance($order_id);
@@ -1464,10 +1758,12 @@
 		
 		/**
+         * DEPRECATED
 		 * Informationen zu einer authorisierten Zahlung holen
 		 * @param unknown $payment_id
 		 */
-		private function api_getPaymentInfo($payment_id, $noError = false)
-		{
-			
+		private function api_getPaymentInfo($payment_id, $noError = false) {
+
+		    throw new \Exception(__('Veraltet', 'wpsg'));
+
 			$json_data = $this->api_call('v1/payments/payment/'.$payment_id, false, $this->api_getAccessToken(), false, $noError);
 									
@@ -1475,5 +1771,22 @@
 			
 		} // private function api_getPaymentInfo($payment_id)
-		
+
+        /**
+         * Informationen zu einer authorisierten Zahlung holen
+         * @param unknown $payment_id
+         * @throws \Exception
+         */
+        private function api_getPaymentInfo_v2($payment_id, $noError = false) {
+
+            $client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($this->api_getEnvironment());
+            $json_data = $client->execute(new \PayPalCheckoutSdk\Orders\OrdersGetRequest($payment_id));
+            $json_data = json_decode(json_encode($json_data), true)['result'];
+
+            //echo '<pre>'; print_r($json_data); echo '</pre>';
+
+            return $json_data;
+
+        }
+
 		/**
 		 * Generiert einen Access Token
@@ -1483,5 +1796,5 @@
 						
 			$json_data = $this->api_call('v1/oauth2/token', http_build_query(array('grant_type' => 'client_credentials')));
-			
+
 			return $json_data['access_token'];
 			
@@ -1503,5 +1816,6 @@
 			$arHeader = array(
 				'Accept: application/json',
-				'Accept-Language: de_DE'
+				'Accept-Language: de_DE',
+                'Prefer: return=representation'
 			);
 			
@@ -1575,7 +1889,8 @@
 			
 			if ($post_data !== false) curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
-				 
+
 			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-			curl_setopt($ch, CURLOPT_HTTPHEADER, $arHeader);			
+			curl_setopt($ch, CURLOPT_HTTPHEADER, $arHeader);
+            curl_setopt($ch, CURLOPT_HEADER, 0);
 									
 			$output = curl_exec($ch);
@@ -1612,5 +1927,5 @@
 		private function api_handleError($errorValue)
 		{ 
-			
+
 			if ($this->api_try === true) return;
 						
@@ -1637,4 +1952,25 @@
 			
 		} // private function api_handleError($errorValue)
-		
+
+        /**
+         * Autoloader fÃŒr die PayPal Klassen
+         */
+        function spl_autoload($class) {
+
+            $path = null;
+
+            if (substr($class, 0, 18) === "PayPalCheckoutSdk\\") {
+
+                $path = WPSG_PATH_MOD.'mod_paypalapi'.DIRECTORY_SEPARATOR.str_replace("\\", DIRECTORY_SEPARATOR, $class).'.php';
+
+            } else if (substr($class, 0, 11) === "PayPalHttp\\") {
+
+                $path = WPSG_PATH_MOD.'mod_paypalapi'.DIRECTORY_SEPARATOR.str_replace("\\", DIRECTORY_SEPARATOR, $class).'.php';
+
+            }
+
+            if ($path !== null && file_exists($path)) require_once($path);
+
+        } // function spl_autoload($class)
+
 	} // class wpsg_mod_paypalapi extends wpsg_mod_basic
Index: /mods/wpsg_mod_spconditions.class.php
===================================================================
--- /mods/wpsg_mod_spconditions.class.php	(revision 7703)
+++ /mods/wpsg_mod_spconditions.class.php	(revision 7704)
@@ -7,4 +7,5 @@
 		var $id = 3000;				
 		var $inline = true;
+		var $version = "9.9.9";
 		
 		//var $hilfeURL = '';
Index: /views/js/frontend.js
===================================================================
--- /views/js/frontend.js	(revision 7703)
+++ /views/js/frontend.js	(revision 7704)
@@ -209,3 +209,19 @@
 	  
 	};
-	
+
+	wpsg_round = function(value, exp) {
+
+		if (typeof exp === 'undefined' || +exp === 0) return Math.round(value);
+
+		value = +value;
+		exp = +exp;
+
+		if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) return NaN;
+
+		value = value.toString().split('e');
+		value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));
+
+		value = value.toString().split('e');
+		return +(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp));
+
+	}
Index: /views/mods/mod_gutschein/add.phtml
===================================================================
--- /views/mods/mod_gutschein/add.phtml	(revision 7703)
+++ /views/mods/mod_gutschein/add.phtml	(revision 7704)
@@ -23,9 +23,9 @@
 		<?php wpsg_drawForm_AdminboxStart(); ?>
 			
-			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_value', __('Betrag', 'wpsg'), wpsg_ff($this->view['mod_gutschein']['value'])); ?>
+			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_value', __('Betrag', 'wpsg'), wpsg_ff(@$this->view['mod_gutschein']['value'])); ?>
 			<?php echo wpsg_drawForm_Input(false, __('Bereits verwendet'), wpsg_ff($used), ['field_id' => 'wpsg_voucher_used', 'readonly' => true]); ?>
 		
 			<div style="margin-top:-15px;"> 
-				<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_coupon', __('Als Wertgutschein behandeln', 'wpsg'), $this->view['mod_gutschein']['coupon']); ?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_coupon', __('Als Wertgutschein behandeln', 'wpsg'), @$this->view['mod_gutschein']['coupon']); ?>
 			</div>
 		
@@ -34,9 +34,9 @@
 					'w' => __('Absoluter Betrag', 'wpsg'),
 					'p' => __('Prozentual', 'wpsg')
-				), $this->view['mod_gutschein']['calc']); ?>
+				), wpsg_getStr($this->view['mod_gutschein']['calc'], 'w')); ?>
 			</div>
 
-			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_start', __('GÃŒltig ab', 'wpsg'), $this->view['mod_gutschein']['start'], array('datepicker' => true)); ?>
-			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_end', __('GÃŒltig bis', 'wpsg'), $this->view['mod_gutschein']['end'], array('datepicker' => true)); ?>
+			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_start', __('GÃŒltig ab', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['start']), array('datepicker' => true)); ?>
+			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_end', __('GÃŒltig bis', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['end']), array('datepicker' => true)); ?>
 
 			<?php if (!wpsg_isSizedInt($this->view['edit_id'])) { ?>
@@ -59,8 +59,8 @@
 
 			<?php if (!wpsg_isSizedInt($this->view['edit_id'])) { ?>
-			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_count', __('Menge', 'wpsg'), $this->view['mod_gutschein']['count']); ?>
+			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_count', __('Menge', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['count'], '1')); ?>
 			<?php } ?>
 			
-			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_multi', __('Mehrfach verwendbar', 'wpsg'), $this->view['mod_gutschein']['multi']); ?>
+			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_multi', __('Mehrfach verwendbar', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['multi'], '0')); ?>
 			<?php echo wpsg_drawForm_Textarea('wpsg_mod_gutschein_comment', __('Kommentar', 'wpsg'), @$this->view['mod_gutschein']['comment']); ?>
 			<?php if ($this->hasMod('wpsg_mod_productgroups') && wpsg_isSizedArray($this->view['wpsg_mod_gutschein']['arProductGroups'])) { ?>
Index: /views/mods/mod_produktartikel/produkt_edit_allgemein.phtml
===================================================================
--- /views/mods/mod_produktartikel/produkt_edit_allgemein.phtml	(revision 7703)
+++ /views/mods/mod_produktartikel/produkt_edit_allgemein.phtml	(revision 7704)
@@ -10,8 +10,8 @@
 
 <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_ean'))) { ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel[ean]', __('EAN', 'wpsg'), $this->view['data']['ean'], array('help' => 'wpsg_mod_produktartikel_ean')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel[ean]', __('EAN', 'wpsg'), wpsg_getStr($this->view['data']['ean']), array('help' => 'wpsg_mod_produktartikel_ean')); ?>
 <?php } ?>
 
 <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_gtin'))) { ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel[gtin]', __('GTIN', 'wpsg'), $this->view['data']['gtin'], array('help' => 'wpsg_mod_produktartikel_gtin')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel[gtin]', __('GTIN', 'wpsg'), wpsg_getStr($this->view['data']['gtin']), array('help' => 'wpsg_mod_produktartikel_gtin')); ?>
 <?php } ?>
Index: /views/order/product_table.phtml
===================================================================
--- /views/order/product_table.phtml	(revision 7703)
+++ /views/order/product_table.phtml	(revision 7704)
@@ -69,4 +69,5 @@
 				</td>
 			</tr>
+            <?php $this->callMods('order_view_row_before', array(&$p, $i)); ?>
 			<tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?> wpsg_productrow_add">
 				<td class="wpsg_cell_name"></td>
Index: /views/warenkorb/basket.phtml
===================================================================
--- /views/warenkorb/basket.phtml	(revision 7703)
+++ /views/warenkorb/basket.phtml	(revision 7704)
@@ -97,4 +97,7 @@
 						</div>
 					</div>
+
+                    <?php $this->callMods('basket_row_before', array(&$product_data, $i)); ?>
+
 					<div class="product_action">
 						<div class="title">
Index: /views/warenkorb/overview.phtml
===================================================================
--- /views/warenkorb/overview.phtml	(revision 7703)
+++ /views/warenkorb/overview.phtml	(revision 7704)
@@ -227,4 +227,7 @@
 						</div>
 					</div>
+
+                    <?php $this->callMods('overview_row_before', array(&$product_data, $i)); ?>
+
 					<div class="product_action">
 						<div class="title">
