Index: /controller/wpsg_AdminController.class.php
===================================================================
--- /controller/wpsg_AdminController.class.php	(revision 7705)
+++ /controller/wpsg_AdminController.class.php	(revision 7706)
@@ -1069,5 +1069,6 @@
 
 					$arOrder = wpsg_order::find(array(
-						'status' => wpsg_ShopController::STATUS_UNVOLLSTAENDIG
+						'status' => wpsg_ShopController::STATUS_UNVOLLSTAENDIG,
+                        'limit' => [0, 10000]
 					));
 
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7705)
+++ /controller/wpsg_ShopController.class.php	(revision 7706)
@@ -744,4 +744,7 @@
          */
         public function init() {
+
+            // https://codex.wordpress.org/Transients_API
+            if (!session_id()) session_start();
 
             $locale = apply_filters('plugin_locale', get_locale(), 'wpsg');
@@ -1577,6 +1580,5 @@
                 $this->arSystemCheck = $arData;
 
-                if ($countError > 0)
-                {
+                if ($countError > 0) {
 
                     $this->addBackendError(
@@ -3237,6 +3239,5 @@
 			}
 
-			if (!is_admin())
-			{
+			if (!is_admin()) {
 
 				// Sollte die Session noch nicht mit Werten gefÃŒllt sein dann hier die Kundenvoreinstellungen laden
@@ -3264,7 +3265,7 @@
 				if (wpsg_isSizedArray($_REQUEST['wpsg']['checkout'])) $this->basket->save(false);
 
-				$this->basket->save(false);
-
-				}
+				//$this->basket->save(false); Hatte Hartmut mal eingebaut, keine Ahnung warum aber das fÃŒhrt zum stÃ€ndigen speichern der Bestellungen und damit auch zum eintragen der Kunden
+
+			}
 
 		} // public function template_redirect()
@@ -3404,5 +3405,5 @@
 			
 			$this->callMods('sendMail', array($mail_key, $o_id, $k_id, &$empfaenger, &$subject, &$mail_text_send, &$headers, &$anhang));
-			 
+
 			\apply_filters('wpsg_sendMail', [$mail_key, $o_id, $k_id, &$empfaenger, &$subject, &$mail_text_send, &$headers, &$anhang]);
 
Index: /controller/wpsg_SystemController.class.php
===================================================================
--- /controller/wpsg_SystemController.class.php	(revision 7705)
+++ /controller/wpsg_SystemController.class.php	(revision 7706)
@@ -162,5 +162,5 @@
         /**
          * Gibt die Antwort einer URL zurÃŒck
-         * @throws \wpsg\Exception
+         * @throws Exception
          */
 		public function get_url_content($url) {
@@ -169,5 +169,5 @@
 
 			if (is_array($result)) return $result['body'];
-			else throw new \wpsg\Exception($result->errors);
+			else throw new Exception($result->errors);
 			 			
 		} // public function get_url_content($url)
@@ -177,6 +177,5 @@
  		 * Wird mittels writeBackendMessage ausgegeben
 		 */
-		public function addBackendMessage($message)
-		{
+		public function addBackendMessage($message) {
 
             $message_key = md5($message);
@@ -221,7 +220,6 @@
 		 * @return bool|void
 		 */
-		public function addBackendError($message, $hideLinkKey = false, $addBlendOut = true)
-		{
-			
+		public function addBackendError($message, $hideLinkKey = false, $addBlendOut = true) {
+
 			if ($hideLinkKey === false) $message_key = md5($message);
 			else $message_key = $hideLinkKey;
@@ -261,5 +259,5 @@
 
             }
-							
+
 			$_SESSION['wpsg']['backendError'][$message_key] = $message;
 							
Index: /lib/filter_functions.inc.php
===================================================================
--- /lib/filter_functions.inc.php	(revision 7705)
+++ /lib/filter_functions.inc.php	(revision 7706)
@@ -34,22 +34,17 @@
     } // function wpsg_dispatch()
     
-    function wpsg_admin_notices()
-    {
-    
+    function wpsg_admin_notices() {
+
         $wpsg_update_data = wpsg_get_update_data();
     
-        if (is_object($wpsg_update_data['updateData']))
-        {
-    
-            if (property_exists($wpsg_update_data['updateData'], 'banner'))
-            {
+        if (is_object($wpsg_update_data['updateData'])) {
+    
+            if (property_exists($wpsg_update_data['updateData'], 'banner')) {
     
                 $arBanner = $wpsg_update_data['updateData']->banner;
     
-                if (wpsg_isSizedArray($arBanner))
-                {
-    
-                    foreach ($arBanner as $b)
-                    {
+                if (wpsg_isSizedArray($arBanner)) {
+
+                    foreach ($arBanner as $b) {
     
                         echo '<div class="wpsg_banner '.$b['class'].'">';
@@ -64,5 +59,5 @@
     
         }
-    
+
         echo $GLOBALS['wpsg_sc']->writeBackendMessage();
     
Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 7705)
+++ /lib/wpsg_basket.class.php	(revision 7706)
@@ -672,5 +672,5 @@
 		 */
 		public function save($finish_order = true, $sendmail = true, $save = false) {
-			
+
 			$knr = '';
 			 			
@@ -686,5 +686,5 @@
 				
 				$this->shop->callMods('basket_save_kunde', array(&$data, &$this->arCheckout));
-				
+
 				$k_id = wpsg_getStr($this->arCheckout['id']);
 				
@@ -742,5 +742,5 @@
 						
 						if (!wpsg_isSizedInt($_SESSION['wpsg']['checkout']['id'])) {
-							
+
 							$k_id = $this->db->ImportQuery(WPSG_TBL_KU, $data);
 							
Index: /lib/wpsg_header.class.php
===================================================================
--- /lib/wpsg_header.class.php	(revision 7705)
+++ /lib/wpsg_header.class.php	(revision 7706)
@@ -65,5 +65,20 @@
 			
 		} // public static function JSONData()
-		
+
+        public static function AUTO($file, $filename = false) {
+
+            if ($filename === false) $filename = basename($file);
+
+            header('Content-Disposition: inline; filename="'.$filename.'"');
+
+            header('Pragma: public');
+            header('Content-type: '.\mime_content_type($file));
+            header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
+            header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Datum in der Vergangenheit
+
+            readfile($file);
+
+        }
+
 		public static function ZIP($file, $filename = false)
 		{
Index: /model/wpsg_exception.class.php
===================================================================
--- /model/wpsg_exception.class.php	(revision 7705)
+++ /model/wpsg_exception.class.php	(revision 7706)
@@ -19,6 +19,5 @@
         private $data = null;
         
-        public function __construct($message, $typ = null, $arData = array(), $code = 0, Exception $previous = null)
-        {
+        public function __construct($message, $typ = null, $arData = array(), $code = 0, Exception $previous = null) {
                         
             parent::__construct($message, $code, $previous);
Index: /model/wpsg_model.class.php
===================================================================
--- /model/wpsg_model.class.php	(revision 7705)
+++ /model/wpsg_model.class.php	(revision 7706)
@@ -5,10 +5,11 @@
 	 * @author Daschmi
 	 */
-	class wpsg_model
-	{
+	class wpsg_model {
 		
 		/** @var array */
 		public static $_objCache = array();
 
+		private $arMeta = null;
+
 		/** @var wpsg_db */
 		var $db = false;
@@ -34,6 +35,10 @@
 		
 		public function getId() {
-			
-			return intval($this->data['id']??'');
+
+		    $id = 0;
+
+            if (isset($this->data['id'])) $id = intval($this->data['id']);
+
+            return $id;
 			
 		}
@@ -114,6 +119,5 @@
 				return [];
 				
-			}
-			else {
+			} else {
 				
 				if (!isset(self::$_objCache[$class_name]) || !array_key_exists($id, self::$_objCache[$class_name]) || $noCache === true) {
@@ -200,5 +204,5 @@
          * Gibt einen META Value zurÃŒck
          */
-        public function getMeta($meta_key) {
+        public function getMeta($meta_key, $reload = false) {
 
             $class = get_called_class();
@@ -206,7 +210,20 @@
             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;
+            if ($this->arMeta === null || $reload === true) {
+
+                $this->arMeta = $this->db->fetchAssocField("
+                    SELECT
+                        M.`meta_key`, M.`meta_value`
+                    FROM 
+                        `".WPSG_TBL_META."` AS M
+                    WHERE
+                        M.`meta_table` = '".wpsg_q($class::$_tableName)."' AND
+                        M.`target_id` = '".wpsg_q($this->getId())."' 
+                ", "meta_key", "meta_value");
+
+            }
+
+            if (array_key_exists($meta_key, $this->arMeta)) return $this->arMeta[$meta_key];
+            else return '';
 
         } // public function getMeta($meta_key)
Index: /model/wpsg_order_product.class.php
===================================================================
--- /model/wpsg_order_product.class.php	(revision 7705)
+++ /model/wpsg_order_product.class.php	(revision 7706)
@@ -109,4 +109,13 @@
 
         }
+
+        /**
+         * @return wpsg_order
+         */
+        public function getOrder() {
+
+            return wpsg_order::getInstance($this->data['o_id']);
+
+        }
         
         public function getPrice($tax_view = WPSG_NETTO) {
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 7705)
+++ /model/wpsg_product.class.php	(revision 7706)
@@ -970,16 +970,13 @@
          * @return wpsg_product
          */
-		public static function getInstance($product_key, $noCache = false)
-		{
+		public static function getInstance($product_key, $noCache = false) {
 			
 			$class_name = get_called_class();
 			 
-			if (wpsg_isSizedArray($product_key))
-			{
+			if (wpsg_isSizedArray($product_key)) {
 				
 				$arReturn = [];
 				
-				foreach ($product_key as $_id)
-				{
+				foreach ($product_key as $_id) {
 					
 					$arReturn[$_id] = self::getInstance($_id);
@@ -989,11 +986,8 @@
 				return $arReturn;
 				
-			}
-			else if (is_array($product_key)) return array();
-			else
-			{
-			
-				if (!array_key_exists($class_name.'_'.$product_key, self::$_objCache) || $noCache === true)
-				{
+			} else if (is_array($product_key)) return array();
+			else {
+			
+				if (!array_key_exists($class_name.'_'.$product_key, self::$_objCache) || $noCache === true) {
 					
 					$product_id = $GLOBALS['wpsg_sc']->getProduktId($product_key);
Index: /mods/wpsg_mod_kundenverwaltung.class.php
===================================================================
--- /mods/wpsg_mod_kundenverwaltung.class.php	(revision 7705)
+++ /mods/wpsg_mod_kundenverwaltung.class.php	(revision 7706)
@@ -363,9 +363,7 @@
 		} // public function dispatch()
 
-		public function checkCheckout(&$state, &$error, &$arCheckout) 
-		{
-			
-			if (isset($_REQUEST['wpsg_mod_kundenverwaltung_login']))
-			{
+		public function checkCheckout(&$state, &$error, &$arCheckout) {
+			
+			if (isset($_REQUEST['wpsg_mod_kundenverwaltung_login'])) {
 											
 				// Error wird immer true, damit checkout2 nicht aufgerufen wird	
@@ -379,9 +377,7 @@
 								
 			}
-			else if ($state == 1)
-			{
-
-				if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_kundenverwaltung_wpuser')))
-				{
+			else if ($state == 1) {
+
+				if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_kundenverwaltung_wpuser'))) {
 					
 					$temp = wpsg_customer::find(array('email' => $arCheckout['email']));
@@ -399,5 +395,5 @@
 						$_SESSION['wpsg']['errorFields'][] = 'email';						
 						$error = true;
-						
+
 						$_REQUEST['wpsg_checkout'] = 1;
 						
@@ -408,6 +404,5 @@
 				}
 				
-				if (isset($_REQUEST['wpsg']['mod_kundenverwaltung']['pwd1']) && isset($_REQUEST['wpsg']['mod_kundenverwaltung']['pwd2']))
-				{
+				if (isset($_REQUEST['wpsg']['mod_kundenverwaltung']['pwd1']) && isset($_REQUEST['wpsg']['mod_kundenverwaltung']['pwd2'])) {
 										
 					// Registrierungszwang und leer
@@ -478,6 +473,5 @@
 					
 					// Kunde ist nicht eingeloggt
-					if ($this->shop->get_option('wpsg_mod_kundenverwaltung_loginZwang') == '1')
-					{
+					if ($this->shop->get_option('wpsg_mod_kundenverwaltung_loginZwang') == '1') {
 					
 						$kunde_id = $this->db->fetchOne("SELECT K.`id` FROM `".WPSG_TBL_KU."` AS K WHERE K.`email` = '".wpsg_q($arCheckout['email'])."'");
@@ -498,7 +492,7 @@
 						$kunde_id = $this->db->fetchOne($strQuery);
 						
-						if ($kunde_id > 0)
-						{
-				 
+						if ($kunde_id > 0) {
+
+						    // !!!!
 							$this->shop->addFrontendError(__('Ein Kunde mit dieser E-Mail Adresse existiert bereits, bitte loggen Sie sich ein oder fordern Sie ein neues Passwort an!', 'wpsg'));
 							
Index: /mods/wpsg_mod_paypalapi.class.php
===================================================================
--- /mods/wpsg_mod_paypalapi.class.php	(revision 7705)
+++ /mods/wpsg_mod_paypalapi.class.php	(revision 7706)
@@ -44,7 +44,7 @@
 		} // public function init()
 				
-		public function install()
-		{
-			
+		public function install() {
+
+            $this->shop->checkDefault('wpsg_mod_paypalapi_version', 'v2');
 			$this->shop->checkDefault('wpsg_mod_paypalapi_aktiv', '1');
 			$this->shop->checkDefault('wpsg_mod_paypalapi_paypalexpress', '1');
@@ -66,13 +66,4 @@
 		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();
 				
@@ -112,5 +103,6 @@
 				
 			}
-			 
+
+            $this->shop->update_option('wpsg_mod_paypalapi_version', $_REQUEST['wpsg_mod_paypalapi_version'], false, false, WPSG_SANITIZE_VALUES, ['v1', 'v2']);
 			$this->shop->update_option('wpsg_mod_paypalapi_clientid', $_REQUEST['wpsg_mod_paypalapi_clientid'], false, false, WPSG_SANITIZE_APIKEY);
 			$this->shop->update_option('wpsg_mod_paypalapi_secret', $_REQUEST['wpsg_mod_paypalapi_secret'], false, false, WPSG_SANITIZE_APIKEY);
@@ -194,5 +186,5 @@
 					
 				}
-				
+
 				$nProductWithoutAnr = intval($this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS."` WHERE `anr` = '' AND `deleted` != '1' AND `lang_parent` = '0' "));
 				
@@ -266,24 +258,37 @@
         } // public function wpsg_deinstall_sites()
 
-		public function setOrderStatus($order_id, $status_id, $inform)
-		{
+		public function setOrderStatus($order_id, $status_id, $inform) {
 		
 			$oOrder = wpsg_order::getInstance($order_id);
 			
-			if ($oOrder->getPaymentID() == $this->id)
-			{
+			if ($oOrder->getPaymentID() == $this->id) {
 				
 				$arStornoState = (array)$this->shop->get_option('wpsg_mod_paypalapi_stornostate');
 			
-				if (array_key_exists($status_id, $arStornoState) && $arStornoState[$status_id] == '1')
-				{
-					
-					if (wpsg_isSizedString($oOrder->getMeta('wpsg_mod_paypalapi_saleid')))
-					{
-					
-						$bStorno = $this->stornoOrder($order_id);
-						
-						if ($bStorno === true) $this->shop->addBackendMessage(__('Zahlung erfolgreich ÃŒber die PayPal API storniert.', 'wpsg'));
-						else $this->shop->addBackendError(__('Es gab ein Problem bei der Stornierung der Zahlung ÃŒber die PayPal API. Bitte Bestellprotokoll beachten.', 'wpsg'));
+				if (array_key_exists($status_id, $arStornoState) && $arStornoState[$status_id] == '1') {
+					
+					if (wpsg_isSizedString($oOrder->getMeta('wpsg_mod_paypalapi_saleid'))) {
+
+                        $state = $this->getState($order_id);
+
+                        if ($this->shop->get_option('wpsg_mod_paypalapi_version') === 'v2') {
+
+                            if ($state[1] === 'COMPLETED') {
+
+                                $bStorno = $this->stornoOrder($order_id);
+
+                                if ($bStorno === true) $this->shop->addBackendMessage(__('Zahlung erfolgreich ÃŒber die PayPal API storniert.', 'wpsg'));
+                                else $this->shop->addBackendError(__('Es gab ein Problem bei der Stornierung der Zahlung ÃŒber die PayPal API. Bitte Bestellprotokoll beachten.', 'wpsg'));
+
+                            } else $this->shop->addBackendError(__('PayPal RÃŒckzahlung nicht mÃ¶glich.'));
+
+                        } else {
+
+                            $bStorno = $this->stornoOrder($order_id);
+
+                            if ($bStorno === true) $this->shop->addBackendMessage(__('Zahlung erfolgreich ÃŒber die PayPal API storniert.', 'wpsg'));
+                            else $this->shop->addBackendError(__('Es gab ein Problem bei der Stornierung der Zahlung ÃŒber die PayPal API. Bitte Bestellprotokoll beachten.', 'wpsg'));
+
+                        }
 						
 					}
@@ -497,7 +502,6 @@
 		} // public function order_ajax()
 		
-		public function order_done(&$order_id, &$done_view)
-		{
-		 
+		public function order_done(&$order_id, &$done_view) {
+
 			// Bestellungen mit 0 geben nix aus
 			if ($done_view['basket']['sum']['preis_gesamt_brutto'] <= 0) return;
@@ -567,5 +571,5 @@
 
 				$approval_url = "";
-				foreach ($json_data['links'] as $k => $l) if ($l['rel'] == 'approve') $approval_url = $l['href'];
+				foreach ($json_data['links'] as $k => $l) if ($l['rel'] == 'approve' || $l['rel'] == 'approval_url') $approval_url = $l['href'];
 				
 				$this->shop->view['wpsg_mod_paypalapi']['approval_url'] = $approval_url;
@@ -722,27 +726,44 @@
 			
 			$jsonData = json_decode($bodyReceived, true);
-			
-			$payment_id = $jsonData['resource']['parent_payment'];
-			$amount = $jsonData['resource']['amount']['total'];
-			$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($payment_id)."' ");
-			
-			$oOrder = wpsg_order::getInstance($order_id);			
-			if ($oOrder === false) die(__('Keine Bestellung zu PaymentID gefunden.', 'wpsg'));
-			
-			list($payment_state, $sale_state, $result) = $this->getState($order_id);
-			$orderPaymentID = $oOrder->getMeta('wpsg_mod_paypalapi_paymentid');
-			
-			if ($this->shop->setPayMent($oOrder->id, $amount) && $orderPaymentID === $payment_id && $payment_state === 'approved' && $sale_state === 'completed') {
-
-                $oOrder->log(__('PayPalAPI WebHook Erfolg', 'wpsg'), print_r($jsonData, 1));
+
+			if ($jsonData['event_type']['PAYMENT.CAPTURE.COMPLETED']) {
+
+			    $saleID = $jsonData['resource']['id'];
+
+			    $order_id = intval($this->db->fetchOne("SELECT `target_id` FROM `".WPSG_TBL_META."` WHERE `meta_table` = 'WPSG_TBL_ORDER' AND `meta_key` = 'wpsg_mod_paypalapi_saleid' AND `meta_value` = '".wpsg_q($saleID)."' "));
+			    $amount = $jsonData['resource']['amount']['value'];
+
+            } else {
+
+                $payment_id = $jsonData['resource']['parent_payment'];
+                $amount = $jsonData['resource']['amount']['total'];
+                $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($payment_id)."' ");
+
+            }
+
+            $oOrder = wpsg_order::getInstance($order_id);
+            if ($oOrder === false) die(__('Keine Bestellung zu PaymentID gefunden.', 'wpsg'));
+
+            list($payment_state, $sale_state, $result) = $this->getState($order_id);
+            $orderPaymentID = $oOrder->getMeta('wpsg_mod_paypalapi_paymentid');
+
+            if ($this->shop->get_option('wpsg_mod_paypalapi_version') === 'v1' && $this->shop->setPayMent($oOrder->id, $amount) && $orderPaymentID === $payment_id && $payment_state === 'approved' && $sale_state === 'completed') {
+
+                $oOrder->log(__('PayPalAPI V1 WebHook Erfolg', 'wpsg'), print_r($jsonData, 1));
 			    
 				$this->shop->setOrderStatus($oOrder->id, 100, true);					 			
-								
-			} else {
-				
-				$oOrder->log(__('PayPalAPI Abgelehnt', 'wpsg', print_r($jsonData, 1)."\r\nOrder PaymentID:".$orderPaymentID."\r\nRequest PaymentID:".$payment_id."\r\nOrder State:".$state));
+
+            } else if ($this->shop->get_option('wpsg_mod_paypalapi_version') === 'v2' && $this->shop->setPayMent($oOrder->id, $amount) && $payment_state === 'COMPLETED' && $sale_state === 'COMPLETED') {
+
+                $oOrder->log(__('PayPalAPI V2 WebHook Erfolg', 'wpsg'), print_r($jsonData, 1));
+
+                $this->shop->setOrderStatus($oOrder->id, 100, true);
+
+            } else {
+				
+				$oOrder->log(__('PayPalAPI Abgelehnt', 'wpsg'), print_r($jsonData, 1)."\r\nOrder PaymentID:".$orderPaymentID."\r\nRequest PaymentID:".$payment_id);
 									
 			}
-			 
+
 			header('HTTP/1.1 200 OK'); exit(1);
 						
@@ -761,6 +782,6 @@
 
 			$approval_url = false;
-			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approve') $approval_url = $l['href']; }
-  
+			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approve' || $l['rel'] == 'approval_url') $approval_url = $l['href']; }
+
 			$this->shop->redirect($approval_url);
 			
@@ -795,8 +816,5 @@
 
 			}
-				
-			$execute_url = false;
-			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approval_url') $execute_url = $l['href']; }
-			
+
 			$_SESSION['wpsg']['checkout']['payment'] = $this->id;
 
@@ -821,15 +839,19 @@
 			if ($this->shop->hasMod('wpsg_mod_shippingadress') && !isset($_SESSION['wpsg']['checkout']['diff_shippingadress'])) {
 
-			    if (isset($json_data['purchase_units'][0]['shipping'])) {
+                $shipping = wpsg_getArray($json_data['purchase_units'][0]['shipping']);
+
+			    if (wpsg_isSizedArray($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'])))."'");
+                    $arName = wpsg_explodeName($shipping['name']['given_name']);
+
+                    $_SESSION['wpsg']['checkout']['shipping_vname'] = wpsg_getStr($arName[0]);
+                    $_SESSION['wpsg']['checkout']['shipping_name'] = wpsg_getStr($arName[1]);
+
+                    $_SESSION['wpsg']['checkout']['shipping_strasse'] = wpsg_getStr($shipping['address']['address_line_1']);
+                    $_SESSION['wpsg']['checkout']['shipping_plz'] = wpsg_getStr($shipping['address']['postal_code']);
+                    $_SESSION['wpsg']['checkout']['shipping_ort'] = wpsg_getStr($shipping['address']['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($shipping['address']['country_code'])))."'");
 
                 }
@@ -905,5 +927,5 @@
 
 			$approval_url = false;
-			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approve') $approval_url = $l['href']; }
+			foreach ($json_data['links'] as $l) { if ($l['rel'] == 'approve' || $l['rel'] == 'approval_url') $approval_url = $l['href']; }
 			
 			// Das war mal drin mir ist nicht klar warum:
@@ -953,21 +975,17 @@
 		 * Wird optional beim speichern ausgelÃ¶st, versucht den WebHook anzulegen und setzt die BackendMeldungen
 		 */
-		private function createWebHook()
-		{
-		
-			$create_webhook = false;
+		private function createWebHook() {
+
+			$create_webhook = false; $nExists = false;
 			$wh_url = $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'webHook', array(), true);
-			
+
 			$arWH = $this->api_getWebHooks();
-					
-			if (wpsg_isSizedArray($arWH))
-			{
-				
-				foreach ($arWH as $wh)
-				{
-				
-					if ($wh['url'] === $wh_url)
-					{
-				
+
+			if (wpsg_isSizedArray($arWH)) {
+
+				foreach ($arWH as $wh) {
+				
+					if ($wh['url'] === $wh_url) {
+
 						$nExists = true;
 						break;
@@ -978,6 +996,5 @@
 				
 				if ($nExists === false) $create_webhook = true;
-				else
-				{
+				else {
 						
 					$this->shop->addBackendError(__('WebHook ist bereits registriert.', 'wpsg'));
@@ -985,17 +1002,15 @@
 				}
 				
-			}
-			else $create_webhook = true;
-			
-			if ($create_webhook === true)
-			{
-				
+			} else $create_webhook = true;
+
+			if ($create_webhook === true) {
+
 				$bOK = $this->api_createWebHook($wh_url);
-				
+
 				if ($bOK === true) $this->shop->addBackendMessage(__('WebHook erfolgreich angelegt.', 'wpsg'));
 				else $this->shop->addBackendError(__('WebHook konnte nicht angelegt werden.', 'wpsg'));
 				
 			}
-			 				
+
 		} // private function createWebHook();
 		
@@ -1032,7 +1047,10 @@
 			$oOrder = wpsg_order::getInstance($order_id);
 			if ($oOrder === false) throw new \wpsg\Exception(__('Bei einer Stornierung konnte Bestellung nicht geladen werden', 'wpsg'));
-			
+
+			$payment_id = $oOrder->getMeta('wpsg_mod_paypalapi_paymentId');
 			$sale_id = $oOrder->getMeta('wpsg_mod_paypalapi_saleid');
-			
+
+            $payment_info = $this->api_getPaymentInfo_v2($payment_id);
+
 			$json_data = $this->api_refundSale_v2($sale_id, $oOrder->getAmount());
 			
@@ -1075,6 +1093,4 @@
 		private function api_refundSale($sale_id, $amount) {
 
-		    throw new \Exception(__('Veraltet', 'wpsg'));
-			
 			$post_data = array(
 				'amount' => array(
@@ -1091,4 +1107,10 @@
 
         private function api_refundSale_v2($sale_id, $amount) {
+
+            if ($this->shop->get_option('wpsg_mod_paypalapi_version') === 'v1') {
+
+                return $this->api_refundSale($sale_id, $amount);
+
+            }
 
             $client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($this->api_getEnvironment());
@@ -1112,18 +1134,19 @@
 		 * Erstellt einen neuen WebHook fÃŒr ZahlungseingÃ€nge auf der ÃŒbergebenene URL
 		 */
-		private function api_createWebHook($url)
-		{
+		private function api_createWebHook($url) {
 			
 			$post_data = array(
 				'url' => $url,
 				'event_types' => array(
-					array(
+					[
 						'name' => 'PAYMENT.SALE.COMPLETED'
-					) 
+					], [
+					    'name' => 'PAYMENT.CAPTURE.COMPLETED'
+                    ]
 				)
 			);
 			
 			$json_data = $this->api_call('v1/notifications/webhooks', $post_data, $this->api_getAccessToken());
-			 
+
 			if (wpsg_isSizedString($json_data['id'])) return true;
 			else return false;
@@ -1149,6 +1172,4 @@
 		private function api_executePayment($payment_id, $payer_id) {
 
-		    throw new \Exception(__('Veraltet', 'wpsg'));
-			
 			$post_data = array(
 				'payer_id' => $payer_id
@@ -1162,4 +1183,10 @@
 
         private function api_executePayment_v2($payment_id, $payer_id) {
+
+            if ($this->shop->get_option('wpsg_mod_paypalapi_version') === 'v1') {
+
+                return $this->api_executePayment($payment_id, $payer_id);
+
+            }
 
             $client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($this->api_getEnvironment());
@@ -1256,4 +1283,281 @@
 
         /**
+         * Authorisiert eine Zahlung
+         * https://developer.paypal.com/docs/api/payments/v1/#definition-transaction
+         * https://developer.paypal.com/docs/api/payments/v1/#definition-payer
+         *
+         */
+        private function api_startPayment($arBasket, $order_id = false, $express = true) {
+
+            // Dadurch wird die Bestellung in der DB fixiert und Platzhalter kÃ€nnen generiert werden
+            if (!wpsg_isSizedInt($order_id)) $order_id = $this->shop->basket->save(false, false, true);
+
+            $oOrder = wpsg_order::getInstance($order_id);
+            $access_token = $this->api_getAccessToken();
+
+            $item_list = array(
+                'items' => array()
+            );
+
+            $post_data = array();
+
+            $post_data['transactions'] = array(
+                array(
+                    'amount' => array(
+                        'total' => number_format($arBasket['sum']['preis_gesamt_brutto'], 2),
+                        'currency' => $this->currency
+                    ),
+                    'description' => $this->shop->replaceUniversalPlatzhalter(__($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_subject'), 'wpsg'), $order_id),
+                )
+            );
+
+            $subTotal = 0;
+
+            // Produkte
+            foreach ($arBasket['produkte'] as $k => $p)
+            {
+
+                $product_price = ((wpsg_isSizedString($arBasket['noMwSt'], '1'))?$p['preis_netto']:$p['preis_brutto']);
+
+                $sku = $this->shop->getProductAnr($this->shop->getProduktID($p['id']));
+                if (!wpsg_isSizedString($sku)) $sku = __('n.A.', 'wpsg');
+
+                $item_list['items'][] = array(
+                    'quantity' => $p['menge'],
+                    'name' => $this->shop->getProductName($this->shop->getProduktID($p['id']), true),
+                    'description' => '',
+                    'sku' => $sku,
+                    'url' => $this->shop->getProduktLink($this->shop->getProduktID($p['id'])),
+                    'price' => number_format($product_price, 2),
+                    'currency' => $this->currency
+                );
+
+                $subTotal += $product_price * $p['menge'];
+
+            }
+
+            // Gutschein
+            if (isset($arBasket['sum']['gs_brutto']))
+            {
+
+                $item_list['items'][] = array(
+                    'quantity' => '1',
+                    'name' => __('Gutschein', 'wpsg'),
+                    'description' => wpsg_translate(__('EingelÃ¶ster Gutschein Code:#1#', 'wpsg'), $arBasket['gs']['code']),
+                    'price' => number_format(-1 * $arBasket['sum']['gs_brutto'], 2),
+                    'currency' => $this->currency
+                );
+
+                $subTotal += -1 * $arBasket['sum']['gs_brutto'];
+
+            }
+
+            // Zahlungskosten/VergÃŒnstigungen
+            if (isset($arBasket['sum']['preis_payment_brutto']) && $arBasket['sum']['preis_payment_brutto'] != 0)
+            {
+
+                $item_list['items'][] = array(
+                    'quantity' => '1',
+                    'name' => (($arBasket['sum']['preis_payment_brutto'] > 0)?__('GebÃŒhr fÃŒr Zahlungsart', 'wpsg'):__('Rabatt durch Zahlungsart', 'wpsg')),
+                    'description' => __('Rabatt, der Aufgrund der gewÃ€hlten Zahlungsart entstanden ist.', 'wpsg'),
+                    'price' => number_format($arBasket['sum']['preis_payment_brutto'], 2),
+                    'currency' => $this->currency
+                );
+
+                $subTotal += $arBasket['sum']['preis_payment_brutto'];
+
+            }
+
+            // Rabatte auf Warenkorb
+            if (isset($arBasket['sum']['preis_rabatt_brutto']) && $arBasket['sum']['preis_rabatt_brutto'] > 0)
+            {
+
+                $item_list['items'][] = array(
+                    'quantity' => '1',
+                    'name' => __('Rabatt', 'wpsg'),
+                    'description' => __('Rabatt, der sich aus dem Warenkorbwert ergibt.', 'wpsg'),
+                    'price' => number_format(-1 * $arBasket['sum']['preis_rabatt_brutto'], 2),
+                    'currency' => $this->currency
+                );
+
+                $subTotal += -1 * $arBasket['sum']['preis_rabatt_brutto'];
+
+            }
+
+            /** @var wpsg_country $oInvoiceCountry */
+            $oInvoiceCountry = null; if (wpsg_isSizedInt($arBasket['checkout']['land'])) $oInvoiceCountry = wpsg_country::getInstance($arBasket['checkout']['land']);
+
+            /** @var wpsg_country $oShippingCountry */
+            $oShippingCountry = null;
+            if ($oInvoiceCountry !== null) $oShippingCountry = $oInvoiceCountry;
+            if (wpsg_isSizedInt($arBasket['checkout']['shipping_land'])) $oShippingCountry = wpsg_country::getInstance($arBasket['checkout']['shipping_land']);
+
+            $post_data['intent'] = 'sale';
+            $post_data['payer'] = array(
+                'payment_method' => 'paypal'
+            );
+
+            if ($oInvoiceCountry !== null && wpsg_isSizedString($arBasket['checkout']['plz'])) {
+
+                $post_data['payer']['payer_info'] = [
+                    'email' => $arBasket['checkout']['email'],
+                    'first_name' => $arBasket['checkout']['vname'],
+                    'last_name' => $arBasket['checkout']['name'],
+                    'billing_address' => [
+                        'line1' => trim($arBasket['checkout']['strasse']),
+                        'line2' => '',
+                        'city' => trim($arBasket['checkout']['ort']),
+                        'country_code' => $oInvoiceCountry->getShorttext(),
+                        'postal_code' => trim($arBasket['checkout']['plz']),
+                    ]
+                ];
+
+                if (strtotime($arBasket['checkout']['geb']) > 0) {
+
+                    $post_data['payer']['payer_info']['birth_date'] = date('Y-m-d', strtotime($arBasket['checkout']['geb']));
+
+                }
+
+                if (preg_match('/^(?:\((\+?\d+)?\)|\+?\d+) ?\d*(-?\d{2,3} ?){0,4}$/', $arBasket['checkout']['tel'])) {
+
+                    $post_data['payer']['payer_info']['billing_address']['phone'] = preg_replace('/ /', '', $arBasket['checkout']['tel']);
+
+                }
+
+            }
+
+            if ($oOrder->getId() > 0 && $oOrder->status == wpsg_ShopController::STATUS_UNVOLLSTAENDIG)
+            {
+
+                $post_data['redirect_urls'] = array(
+                    'return_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'returnPayPalExpress'),
+                    'cancel_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET)
+                );
+
+            }
+            else
+            {
+
+                $post_data['redirect_urls'] = array(
+                    'return_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'returnPayPalExpress'),
+                    'cancel_url' => $this->shop->getDoneURL($oOrder->id)
+                );
+
+            }
+
+            // Versandkosten/VergÃŒnstigungen
+            if (isset($arBasket['sum']['preis_shipping_brutto']) && $arBasket['sum']['preis_shipping_brutto'] > 0)
+            {
+
+                $details['shipping'] = number_format($arBasket['sum']['preis_shipping_brutto'], 2);
+
+            }
+            else if (isset($arBasket['sum']['preis_shipping_brutto']) && $arBasket['sum']['preis_shipping_brutto'] < 0)
+            {
+
+                $item_list['items'][] = array(
+                    'quantity' => '1',
+                    'name' => __('Rabatt aufgrund Versandart', 'wpsg'),
+                    'price' => number_format($arBasket['sum']['preis_shipping_brutto'], 2),
+                    'currency' => $this->currency
+                );
+
+                $subTotal += $arBasket['sum']['preis_shipping_brutto'];
+
+            }
+
+            //wpsg_debug($item_list);
+            //wpsg_debug($subTotal);
+
+            /*
+             * Daschmi@14.12.2016
+             * Ich vergleiche hier die Summe der Positionen mit dem ÃŒbergebenen Brutto
+             * Bei Nettorechnungen kann es hier zu Problemen fÃŒhren Siehe Track Ticket 505
+             */
+
+            $shipping_address = [];
+
+            // Lieferadresse
+            if ($oShippingCountry !== null) {
+
+                if (wpsg_getStr($arBasket['checkout']['diff_shippingadress']) == '1') {
+
+                    $shipping_address = [
+                        'recipient_name' => trim($arBasket['checkout']['shipping_firma'].' '.$arBasket['checkout']['shipping_vname'].' '.$arBasket['checkout']['shipping_name']),
+                        'line1' => trim($arBasket['checkout']['shipping_strasse']),
+                        'line2' => '',
+                        'city' => trim($arBasket['checkout']['shipping_ort']),
+                        'country_code' => $oShippingCountry->getShorttext(),
+                        'postal_code' => trim($arBasket['checkout']['shipping_plz'])
+                    ];
+
+                } else {
+
+                    $shipping_address = [
+                        'recipient_name' => trim($arBasket['checkout']['firma'].' '.$arBasket['checkout']['vname'].' '.$arBasket['checkout']['name']),
+                        'line1' => trim($arBasket['checkout']['strasse']),
+                        'line2' => '',
+                        'city' => trim($arBasket['checkout']['ort']),
+                        'country_code' => $oShippingCountry->getShorttext(),
+                        'postal_code' => trim($arBasket['checkout']['plz'])
+                    ];
+
+                }
+
+            }
+
+            if (wpsg_isSizedArray($shipping_address) && isset($post_data['transactions'][0]['item_list'])) {
+
+                $post_data['transactions'][0]['item_list']['shipping_address'] = $shipping_address;
+
+            }
+
+            if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_details')) && floatval($subTotal) === floatval($arBasket['sum']['preis_gesamt_brutto']))
+            {
+
+                if (wpsg_isSizedArray($details))
+                {
+
+                    $post_data['transactions'][0]['amount']['details'] = $details;
+                    $post_data['transactions'][0]['amount']['details']['subtotal'] = number_format($subTotal, 2);
+
+                }
+
+                $post_data['transactions'][0]['item_list'] = $item_list;
+            }
+            else
+            {
+
+                $post_data['transactions'][0]['item_list'] = array(
+                    'items' => array(
+                        array(
+                            'quantity' => '1',
+                            'name' => $this->shop->replaceUniversalPlatzhalter(__($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_subject'), 'wpsg'), $order_id),
+                            'price' => number_format($arBasket['sum']['preis_gesamt_brutto'], 2),
+                            'currency' => $this->currency
+                        )
+                    )
+                );
+
+            }
+
+            if (wpsg_isSizedString($this->shop->get_option('wpsg_mod_paypalapi_paymentExperience')))
+            {
+
+                $post_data['experience_profile_id'] = $this->shop->get_option('wpsg_mod_paypalapi_paymentExperience');
+
+            }
+
+            //die('<pre>'.print_r($post_data, true).'</pre>');
+
+            $json_data = $this->api_call('v1/payments/payment', $post_data, $access_token);
+
+            if (wpsg_isSizedString($json_data['id'])) $oOrder->setMeta('wpsg_mod_paypalapi_paymentId', $json_data['id']);
+
+            return $json_data;
+
+        } // private function api_startPayment()
+
+        /**
          * @param $arBasket
          * @param bool $order_id
@@ -1262,4 +1566,10 @@
          */
         private function api_startPayment_v2($arBasket, $order_id = false, $express = true) {
+
+            if ($this->shop->get_option('wpsg_mod_paypalapi_version') === 'v1') {
+
+                return $this->api_startPayment($arBasket, $order_id, $express);
+
+            }
 
             if (!wpsg_isSizedInt($order_id)) $order_id = $this->shop->basket->save(false, false, true);
@@ -1479,283 +1789,4 @@
 
 		/**
-		 * Authorisiert eine Zahlung
-		 * https://developer.paypal.com/docs/api/payments/v1/#definition-transaction
-		 * https://developer.paypal.com/docs/api/payments/v1/#definition-payer
-		 * 
-		 */
-		private function api_startPayment($arBasket, $order_id = false, $express = true) {
-
-		    throw new \Exception("Veraltet");
-						
-			$oOrder = wpsg_order::getInstance($order_id);
-			$access_token = $this->api_getAccessToken();
-			
-			// Dadurch wird die Bestellung in der DB fixiert und Platzhalter kÃ€nnen generiert werden
-			if (!wpsg_isSizedInt($order_id)) $order_id = $this->shop->basket->save(false, false, true);
-						
-			$item_list = array(
-				'items' => array()
-			);
-			
-			$post_data = array();
-						
-			$post_data['transactions'] = array(
-				array(
-					'amount' => array(
-						'total' => number_format($arBasket['sum']['preis_gesamt_brutto'], 2),
-						'currency' => $this->currency
-					),
-					'description' => $this->shop->replaceUniversalPlatzhalter(__($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_subject'), 'wpsg'), $order_id),
-				)
-			);
-				
-			$subTotal = 0;
-			
-			// Produkte
-			foreach ($arBasket['produkte'] as $k => $p)
-			{
-			
-				$product_price = ((wpsg_isSizedString($arBasket['noMwSt'], '1'))?$p['preis_netto']:$p['preis_brutto']);
-				
-				$sku = $this->shop->getProductAnr($this->shop->getProduktID($p['id']));
-				if (!wpsg_isSizedString($sku)) $sku = __('n.A.', 'wpsg');
-				
-				$item_list['items'][] = array(
-					'quantity' => $p['menge'],
-					'name' => $this->shop->getProductName($this->shop->getProduktID($p['id']), true),
-					'description' => '',
-					'sku' => $sku,
-					'url' => $this->shop->getProduktLink($this->shop->getProduktID($p['id'])),
-					'price' => number_format($product_price, 2),
-					'currency' => $this->currency
-				);
-				
-				$subTotal += $product_price * $p['menge'];
-			
-			}
-			
-			// Gutschein
-			if (isset($arBasket['sum']['gs_brutto']))
-			{
-					
-				$item_list['items'][] = array(
-					'quantity' => '1',
-					'name' => __('Gutschein', 'wpsg'),
-					'description' => wpsg_translate(__('EingelÃ¶ster Gutschein Code:#1#', 'wpsg'), $arBasket['gs']['code']),
-					'price' => number_format(-1 * $arBasket['sum']['gs_brutto'], 2),
-					'currency' => $this->currency
-				);
-				
-				$subTotal += -1 * $arBasket['sum']['gs_brutto'];
-			
-			}
-				
-			// Zahlungskosten/VergÃŒnstigungen
-			if (isset($arBasket['sum']['preis_payment_brutto']) && $arBasket['sum']['preis_payment_brutto'] != 0)
-			{
-			
-				$item_list['items'][] = array(
-					'quantity' => '1',
-					'name' => (($arBasket['sum']['preis_payment_brutto'] > 0)?__('GebÃŒhr fÃŒr Zahlungsart', 'wpsg'):__('Rabatt durch Zahlungsart', 'wpsg')),
-					'description' => __('Rabatt, der Aufgrund der gewÃ€hlten Zahlungsart entstanden ist.', 'wpsg'),
-					'price' => number_format($arBasket['sum']['preis_payment_brutto'], 2),
-					'currency' => $this->currency
-				);
-				
-				$subTotal += $arBasket['sum']['preis_payment_brutto'];
-			
-			}
-			
-			// Rabatte auf Warenkorb
-			if (isset($arBasket['sum']['preis_rabatt_brutto']) && $arBasket['sum']['preis_rabatt_brutto'] > 0)
-			{
-				 
-				$item_list['items'][] = array(
-					'quantity' => '1',
-					'name' => __('Rabatt', 'wpsg'),
-					'description' => __('Rabatt, der sich aus dem Warenkorbwert ergibt.', 'wpsg'),
-					'price' => number_format(-1 * $arBasket['sum']['preis_rabatt_brutto'], 2),
-					'currency' => $this->currency						
-				); 
-				
-				$subTotal += -1 * $arBasket['sum']['preis_rabatt_brutto'];
-				
-			} 
-			
-			/** @var wpsg_country $oInvoiceCountry */
-			$oInvoiceCountry = null; if (wpsg_isSizedInt($arBasket['checkout']['land'])) $oInvoiceCountry = wpsg_country::getInstance($arBasket['checkout']['land']);
-			 
-			/** @var wpsg_country $oShippingCountry */
-			$oShippingCountry = null; 			
-			if ($oInvoiceCountry !== null) $oShippingCountry = $oInvoiceCountry;			
-			if (wpsg_isSizedInt($arBasket['checkout']['shipping_land'])) $oShippingCountry = wpsg_country::getInstance($arBasket['checkout']['shipping_land']);
-			
-			$post_data['intent'] = 'sale';
-			$post_data['payer'] = array(
-				'payment_method' => 'paypal'
-			);
-			
-			if ($oInvoiceCountry !== null && wpsg_isSizedString($arBasket['checkout']['plz'])) {
-															
-				$post_data['payer']['payer_info'] = [
-					'email' => $arBasket['checkout']['email'], 
-					'first_name' => $arBasket['checkout']['vname'],
-					'last_name' => $arBasket['checkout']['name'],
-					'billing_address' => [
-						'line1' => trim($arBasket['checkout']['strasse']),
-						'line2' => '',
-						'city' => trim($arBasket['checkout']['ort']),
-						'country_code' => $oInvoiceCountry->getShorttext(),
-						'postal_code' => trim($arBasket['checkout']['plz']),						
-					]
-				];
-				
-				if (strtotime($arBasket['checkout']['geb']) > 0) {
-					
-					$post_data['payer']['payer_info']['birth_date'] = date('Y-m-d', strtotime($arBasket['checkout']['geb']));
-					
-				}
-				
-				if (preg_match('/^(?:\((\+?\d+)?\)|\+?\d+) ?\d*(-?\d{2,3} ?){0,4}$/', $arBasket['checkout']['tel'])) {
-					
-					$post_data['payer']['payer_info']['billing_address']['phone'] = preg_replace('/ /', '', $arBasket['checkout']['tel']); 
-										
-				}
-				
-			}
-			
-			if ($oOrder->getId() > 0 && $oOrder->status == wpsg_ShopController::STATUS_UNVOLLSTAENDIG)
-			{
-			
-				$post_data['redirect_urls'] = array(
-					'return_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'returnPayPalExpress'),
-					'cancel_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET)
-				);
-				
-			}
-			else
-			{
-				
-				$post_data['redirect_urls'] = array(
-					'return_url' => $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'returnPayPalExpress'),
-					'cancel_url' => $this->shop->getDoneURL($oOrder->id)
-				);
-				
-			}
-						
-			// Versandkosten/VergÃŒnstigungen
-			if (isset($arBasket['sum']['preis_shipping_brutto']) && $arBasket['sum']['preis_shipping_brutto'] > 0)
-			{
-				
-				$details['shipping'] = number_format($arBasket['sum']['preis_shipping_brutto'], 2);
-				
-			} 
-			else if (isset($arBasket['sum']['preis_shipping_brutto']) && $arBasket['sum']['preis_shipping_brutto'] < 0)
-			{
-			
-				$item_list['items'][] = array(
-					'quantity' => '1',
-					'name' => __('Rabatt aufgrund Versandart', 'wpsg'),
-					'price' => number_format($arBasket['sum']['preis_shipping_brutto'], 2),
-					'currency' => $this->currency
-				);
-				
-				$subTotal += $arBasket['sum']['preis_shipping_brutto'];
-				
-			}
-			
-			//wpsg_debug($item_list);
-			//wpsg_debug($subTotal); 
-			
-			/*
-			 * Daschmi@14.12.2016
-			 * Ich vergleiche hier die Summe der Positionen mit dem ÃŒbergebenen Brutto 
-			 * Bei Nettorechnungen kann es hier zu Problemen fÃŒhren Siehe Track Ticket 505
-			 */
-			
-			$shipping_address = [];
-			 
-			// Lieferadresse
-			if ($oShippingCountry !== null) {
-			
-				if (wpsg_getStr($arBasket['checkout']['diff_shippingadress']) == '1') {
-				
-					$shipping_address = [
-						'recipient_name' => trim($arBasket['checkout']['shipping_firma'].' '.$arBasket['checkout']['shipping_vname'].' '.$arBasket['checkout']['shipping_name']),
-						'line1' => trim($arBasket['checkout']['shipping_strasse']),
-						'line2' => '',
-						'city' => trim($arBasket['checkout']['shipping_ort']),		
-						'country_code' => $oShippingCountry->getShorttext(),
-						'postal_code' => trim($arBasket['checkout']['shipping_plz'])
-					];
-					
-				} else {
-					
-					$shipping_address = [
-						'recipient_name' => trim($arBasket['checkout']['firma'].' '.$arBasket['checkout']['vname'].' '.$arBasket['checkout']['name']),
-						'line1' => trim($arBasket['checkout']['strasse']),
-						'line2' => '',
-						'city' => trim($arBasket['checkout']['ort']),
-						'country_code' => $oShippingCountry->getShorttext(),
-						'postal_code' => trim($arBasket['checkout']['plz'])
-					];
-					
-				}
-				
-			}
-			
-			if (wpsg_isSizedArray($shipping_address) && isset($post_data['transactions'][0]['item_list'])) {
-			 
-				$post_data['transactions'][0]['item_list']['shipping_address'] = $shipping_address;
-				
-			}
-			
-			if (wpsg_isSizedInt($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_details')) && floatval($subTotal) === floatval($arBasket['sum']['preis_gesamt_brutto']))
-			{
-				
-				if (wpsg_isSizedArray($details))
-				{
-			
-					$post_data['transactions'][0]['amount']['details'] = $details;
-					$post_data['transactions'][0]['amount']['details']['subtotal'] = number_format($subTotal, 2);
-				
-				}
-				
-				$post_data['transactions'][0]['item_list'] = $item_list;
-							}
-			else
-			{
-				
-				$post_data['transactions'][0]['item_list'] = array(
-					'items' => array(
-						array(
-							'quantity' => '1',
-							'name' => $this->shop->replaceUniversalPlatzhalter(__($this->shop->get_option('wpsg_mod_paypalapi_paypalexpress_subject'), 'wpsg'), $order_id),
-							'price' => number_format($arBasket['sum']['preis_gesamt_brutto'], 2),
-							'currency' => $this->currency
-						)
-					)	
-				); 
-				
-			}
-			 
-			if (wpsg_isSizedString($this->shop->get_option('wpsg_mod_paypalapi_paymentExperience')))
-			{
-				
-				$post_data['experience_profile_id'] = $this->shop->get_option('wpsg_mod_paypalapi_paymentExperience');
-				
-			}
-
-			//die('<pre>'.print_r($post_data, true).'</pre>');
-			
-			$json_data = $this->api_call('v1/payments/payment', $post_data, $access_token);
-			 
-			if (wpsg_isSizedString($json_data['id'])) $oOrder->setMeta('wpsg_mod_paypalapi_paymentId', $json_data['id']);
-			 
-			return $json_data;
-			
-		} // private function api_startPayment()
-		
-		/**
          * DEPRECATED
 		 * Informationen zu einer authorisierten Zahlung holen
@@ -1763,6 +1794,4 @@
 		 */
 		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);
@@ -1779,4 +1808,10 @@
         private function api_getPaymentInfo_v2($payment_id, $noError = false) {
 
+            if ($this->shop->get_option('wpsg_mod_paypalapi_version') === 'v1') {
+
+                return $this->api_getPaymentInfo($payment_id, $noError);
+
+            }
+
             $client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($this->api_getEnvironment());
             $json_data = $client->execute(new \PayPalCheckoutSdk\Orders\OrdersGetRequest($payment_id));
Index: /mods/wpsg_mod_printshop.class.php
===================================================================
--- /mods/wpsg_mod_printshop.class.php	(revision 7706)
+++ /mods/wpsg_mod_printshop.class.php	(revision 7706)
@@ -0,0 +1,641 @@
+<?php
+	
+	declare(strict_types=1);
+		
+	/**
+	 * User: Daschmi (daschmi@daschmi.de)
+	 * Date: 14.01.2020
+	 * Time: 07:20
+	 */
+	
+	class wpsg_mod_printshop extends wpsg_mod_basic {
+		
+		protected static $instance = null;
+		private $set_data = null;
+		
+		const MODE_AREA = 1;
+		const MODE_AREA_SELECT = 2;
+		const MODE_LFM = 3;
+		const MODE_LFM_SELECT = 4;
+		
+		var $id = 5501;
+		
+		/**
+		 * Kostructor
+		 */
+		public function __construct() {
+			
+			parent::__construct();
+			
+			$this->name = __('Druckerei', 'wpsg');
+			$this->group = __('Produkte', 'wpsg');
+			$this->desc = __('', 'wpsg');
+			
+		} 
+		
+		public function settings_edit() {
+			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/settings_edit.phtml');
+			
+		}
+		
+		public function product_addedit_content(&$product_content, &$product_data) {
+			
+			// Nur fÃŒr angelegte Produkte
+			if ($product_data['id'] <= 0) return false;
+			 			
+			$oProduct = wpsg_product::getInstance($product_data['id']);
+			
+			$this->shop->view['wpsg_mod_printshop'] = [];
+
+            $this->shop->view['wpsg_mod_printshop']['set'] = intval($oProduct->getMeta('wpsg_mod_printshop_set'));
+            $this->shop->view['wpsg_mod_printshop']['mode'] = intval($oProduct->getMeta('wpsg_mod_printshop_mode'));
+            $this->shop->view['wpsg_mod_printshop']['unit_price'] = sanitize_text_field($oProduct->getMeta('wpsg_mod_printshop_unit_price'));
+            $this->shop->view['wpsg_mod_printshop']['width_step'] = intval($oProduct->getMeta('wpsg_mod_printshop_width_step'));
+            $this->shop->view['wpsg_mod_printshop']['width_min'] = intval($oProduct->getMeta('wpsg_mod_printshop_width_min'));
+            $this->shop->view['wpsg_mod_printshop']['width_max'] = intval($oProduct->getMeta('wpsg_mod_printshop_width_max'));
+            $this->shop->view['wpsg_mod_printshop']['length_step'] = intval($oProduct->getMeta('wpsg_mod_printshop_length_step'));
+            $this->shop->view['wpsg_mod_printshop']['length_min'] = intval($oProduct->getMeta('wpsg_mod_printshop_length_min'));
+            $this->shop->view['wpsg_mod_printshop']['length_max'] = intval($oProduct->getMeta('wpsg_mod_printshop_length_max'));
+            $this->shop->view['wpsg_mod_printshop']['width'] = wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_width'));
+            $this->shop->view['wpsg_mod_printshop']['width'] = wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_width'));
+            $this->shop->view['wpsg_mod_printshop']['productupload_set'] = intval($oProduct->getMeta('wpsg_mod_printshop_productupload_set')) > 0;
+            $this->shop->view['wpsg_mod_printshop']['productupload_length'] = intval($oProduct->getMeta('wpsg_mod_printshop_productupload_length'));
+            $this->shop->view['wpsg_mod_printshop']['productupload_mandatory'] = intval($oProduct->getMeta('wpsg_mod_printshop_productupload_mandatory')) > 0;
+
+			$product_content['wpsg_mod_printshop'] = [
+				'title' => __('Druckereiprodukt', 'wpsg'),
+				'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/produkt_addedit_content.phtml', false)
+			];
+			
+		}
+
+        /**
+         * @param $product_id
+         * @throws Exception
+         */
+		public function produkt_save(&$product_id) {
+
+		    $r = [
+                'set' => intval(@$_REQUEST['wpsg_mod_printshop']['set']),
+		        'mode' => intval(@$_REQUEST['wpsg_mod_printshop']['mode']),
+                'unit_price' => sanitize_text_field(@$_REQUEST['wpsg_mod_printshop']['unit_price']),
+                'width' => wpsg_tf(@$_REQUEST['wpsg_mod_printshop']['width']),
+                'width_step' => intval(@$_REQUEST['wpsg_mod_printshop']['width_step']),
+                'width_min' => intval(@$_REQUEST['wpsg_mod_printshop']['width_min']),
+                'width_max' => intval(@$_REQUEST['wpsg_mod_printshop']['width_max']),
+                'length_step' => intval(@$_REQUEST['wpsg_mod_printshop']['length_step']),
+                'length_min' => intval(@$_REQUEST['wpsg_mod_printshop']['length_min']),
+                'length_max' => intval(@$_REQUEST['wpsg_mod_printshop']['length_max']),
+                'productupload_set' => intval(@$_REQUEST['wpsg_mod_printshop']['productupload_set']),
+                'productupload_length' => intval(@$_REQUEST['wpsg_mod_printshop']['productupload_length']),
+                'productupload_mandatory' => intval(@$_REQUEST['wpsg_mod_printshop']['productupload_mandatory']),
+            ];
+
+		    if ($r['mode'] > 0) {
+
+                $oProduct = wpsg_product::getInstance($product_id);
+
+                $oProduct->setMeta('wpsg_mod_printshop_set', $r['set']);
+                $oProduct->setMeta('wpsg_mod_printshop_mode', $r['mode']);
+                $oProduct->setMeta('wpsg_mod_printshop_unit_price', $r['unit_price']);
+
+                if ($r['mode'] === self::MODE_AREA) {
+
+                } else if ($r['mode'] === self::MODE_AREA_SELECT) {
+
+                    $oProduct->setMeta('wpsg_mod_printshop_width_step', $r['width_step']);
+                    $oProduct->setMeta('wpsg_mod_printshop_width_min', $r['width_min']);
+                    $oProduct->setMeta('wpsg_mod_printshop_width_max', $r['width_max']);
+
+                    $oProduct->setMeta('wpsg_mod_printshop_length_step', $r['length_step']);
+                    $oProduct->setMeta('wpsg_mod_printshop_length_min', $r['length_min']);
+                    $oProduct->setMeta('wpsg_mod_printshop_length_max', $r['length_max']);
+                    
+                } else if ($r['mode'] === self::MODE_LFM) {
+
+                    $oProduct->setMeta('wpsg_mod_printshop_width', $r['width']);
+
+                } else if ($r['mode'] === self::MODE_LFM_SELECT) {
+
+                    $oProduct->setMeta('wpsg_mod_printshop_width', $r['width']);
+                    $oProduct->setMeta('wpsg_mod_printshop_length_step', $r['length_step']);
+                    $oProduct->setMeta('wpsg_mod_printshop_length_min', $r['length_min']);
+                    $oProduct->setMeta('wpsg_mod_printshop_length_max', $r['length_max']);
+
+                } else throw \wpsg\Exception::getInvalidValueException();
+
+                $oProduct->setMeta('wpsg_mod_printshop_productupload_set', $r['productupload_set']);
+                $oProduct->setMeta('wpsg_mod_printshop_productupload_length', $r['productupload_length']);
+                $oProduct->setMeta('wpsg_mod_printshop_productupload_mandatory', $r['productupload_mandatory']);
+
+            }
+
+		}
+
+        /**
+         * @throws Exception
+         */
+		public function basket_preInsert() {
+
+		    $r = [
+		        'insertAreaProduct' => intval($_REQUEST['wpsg']['insertAreaProduct']??0),
+                'product_key' => sanitize_text_field($_REQUEST['wpsg']['product_key']??''),
+                'menge' => intval($_REQUEST['wpsg']['menge']??0),
+                'length' => wpsg_tf($_REQUEST['wpsg']['length']??0),
+                'width' => wpsg_tf($_REQUEST['wpsg']['width']??0)
+            ];
+
+			if ($r['insertAreaProduct'] > 0) {
+			
+				$oProduct = wpsg_product::getInstance($r['product_key']);
+
+				if (intval($oProduct->getMeta('wpsg_mod_printshop_set')) === 1) {
+					
+					$price_onepice = $oProduct->getPrice($r['product_key']);
+						
+					$mode = intval($oProduct->getMeta('wpsg_mod_printshop_mode'));
+
+					if ($mode === wpsg_mod_printshop::MODE_AREA) {
+
+                        $length = $r['length'];
+                        $width = $r['width'];
+
+                    } else if ($mode === wpsg_mod_printshop::MODE_AREA_SELECT) {
+
+                        $arWidth = [];
+                        $arLength = [];
+
+                        for ($i = intval($oProduct->getMeta('wpsg_mod_printshop_width_min')); $i <= intval($oProduct->getMeta('wpsg_mod_printshop_width_max')); $i += intval($oProduct->getMeta('wpsg_mod_printshop_width_step'))) {
+
+                            $arWidth[] = $i;
+
+                        }
+
+                        for ($i = intval($oProduct->getMeta('wpsg_mod_printshop_length_min')); $i <= intval($oProduct->getMeta('wpsg_mod_printshop_length_max')); $i += intval($oProduct->getMeta('wpsg_mod_printshop_length_step'))) {
+
+                            $arLength[] = $i;
+
+                        }
+
+                        if (in_array($r['width'], $arWidth)) $width = $r['width']; else throw \wpsg\Exception::getInvalidValueException();
+                        if (in_array($r['length'], $arLength)) $length = $r['length']; else throw \wpsg\Exception::getInvalidValueException();
+
+                    } else if ($mode === wpsg_mod_printshop::MODE_LFM) {
+
+                        $length = $r['length'];
+                        $width = wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_width'));
+
+                    } else if ($mode === self::MODE_LFM_SELECT) {
+
+                        $arLength = [];
+
+                        for ($i = intval($oProduct->getMeta('wpsg_mod_printshop_length_min')); $i <= intval($oProduct->getMeta('wpsg_mod_printshop_length_max')); $i += intval($oProduct->getMeta('wpsg_mod_printshop_length_step'))) {
+
+                            $arLength[] = $i;
+
+                        }
+
+                        if (in_array($r['length'], $arLength)) $length = $r['length']; else throw \wpsg\Exception::getInvalidValueException();
+
+						$width = wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_width'));
+
+					} else throw wpsg\Exception::getInvalidFunctionException();
+
+                    $price = round($width * $r['length'], 2) * $price_onepice;
+
+					$this->set_data = [
+						'price' => $price,
+						'width' => $width,
+						'length' => $length						
+					];
+
+				} else throw wpsg\Exception::getInvalidFunctionException();
+								
+			}
+			
+		}
+		
+		public function basket_produkttosession($produkt_key, &$menge, &$ses_data) {
+			
+			if ($this->set_data !== null) {
+				
+				$ses_data['wpsg_mod_printshop'] = $this->set_data;
+
+				$this->set_data = null;
+				
+			}
+			
+		}
+
+        public function basket_row_before(&$p, $i) {
+
+		    $oProduct = wpsg_product::getInstance($p['id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_set')) === 1) {
+
+                $this->shop->view['wpsg_mod_printshop'] = [
+                    'width' => wpsg_tf($p['wpsg_mod_printshop']['width']),
+                    'length' => wpsg_tf($p['wpsg_mod_printshop']['length']),
+                    'price_onepice' => $oProduct->getPrice($p['product_key']),
+                    'unit_price' => sanitize_text_field($oProduct->getMeta('wpsg_mod_printshop_unit_price'))
+                ];
+
+                $this->shop->view['wpsg_mod_printshop']['area'] = round($this->shop->view['wpsg_mod_printshop']['width'] * $this->shop->view['wpsg_mod_printshop']['length'], 2);
+
+                $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/basket_row_before.phtml');
+
+            }
+
+        }
+
+        public function basket_row(&$p, $i) {
+
+            $oProduct = wpsg_product::getInstance($p['id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_productupload_set')) === 1) {
+
+                $this->shop->view['wpsg_mod_printshop'] = [
+                    'length' => wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_productupload_length')),
+                    'mandatory' => wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_productupload_mandatory')),
+                    'product_index' => $p['product_index'],
+                    'files' => wpsg_getArray($p['wpsg_mod_printshop']['files'])
+                ];
+
+                $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/basket_row.phtml');
+
+            }
+
+        }
+
+        public function order_ajax() {
+
+		    if (wpsg_isSizedString($_REQUEST['do'], 'download')) {
+
+		        $r = [
+		            'do' => 'download',
+		            'mod' => 'wpsg_mod_printshop',
+                    'noheader' => '1',
+		            'order_id' => intval($_REQUEST['order_id']),
+                    'product_index' => intval($_REQUEST['product_index']),
+                    'file' => sanitize_file_name(rawurldecode($_REQUEST['file']))
+                ];
+
+                wpsg_checkNounce('Order', 'ajax', $r);
+
+                $path = $this->getUploadPath($r['order_id'], $r['product_index'], false).basename($r['file']);
+
+                if (file_exists($path)) {
+
+                    wpsg_header::AUTO($path, $r['file']);
+                    exit;
+
+                }
+
+            }
+
+        }
+
+        public function template_redirect() {
+
+		    if (get_the_ID() === intval($this->shop->get_option('wpsg_page_basket')) &&
+                (isset($_REQUEST['wpsg_basket_refresh']) || isset($_REQUEST['wpsg_basket_submit']))) {
+
+                foreach (wpsg_getArray($_SESSION['wpsg']['basket']) as $product_index => $product_data) {
+
+                    $oProduct = wpsg_product::getInstance($product_data['id']);
+
+                    if ($oProduct->getMeta('wpsg_mod_printshop_productupload_set') === '1') {
+
+                        if (!isset($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'])) $_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'] = [];
+
+                        // Dateien lÃ¶schen
+                        foreach (wpsg_getArray($_REQUEST['wpsg_mod_printshop'][$product_index]['delete_file']) as $file_index) {
+
+                            if (isset($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'][$file_index])) {
+
+                                unlink($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'][$file_index]['tmpnam']);
+                                unset($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'][$file_index]);
+
+                            }
+
+                        }
+
+                        // Dateien hinzufÃŒgen
+                        foreach (wpsg_getArray($_FILES['wpsg_mod_printshop']['error'][$product_index]) as $file_index => $error_code) {
+
+                            if (intval($error_code) === 0) {
+
+                                $tmpnam = tempnam(sys_get_temp_dir(), 'wpsg_mod_printshop');
+
+                                move_uploaded_file($_FILES['wpsg_mod_printshop']['tmp_name'][$product_index][$file_index], $tmpnam);
+
+                                $_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'][] = [
+                                    'tmpnam' => $tmpnam,
+                                    'file_name' => $_FILES['wpsg_mod_printshop']['name'][$product_index][$file_index]
+                                ];
+
+                            }
+
+                        }
+
+                    }
+
+                }
+
+            }
+
+        }
+
+        public function checkBasket(&$ok) {
+
+		    foreach (wpsg_getArray($_SESSION['wpsg']['basket']) as $product_index => $product_data) {
+
+		        $oProduct = wpsg_product::getInstance($product_data['id']);
+
+		        if ($oProduct->getMeta('wpsg_mod_printshop_productupload_set') === '1') {
+
+                    if (!isset($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'])) $_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'] = [];
+
+                    // Maximalanzahl prÃŒfen
+                    $max_upload = intval($oProduct->getMeta('wpsg_mod_printshop_productupload_length'));
+
+                    if ($max_upload > 0 && sizeof($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files']) > $max_upload) {
+
+                        $this->shop->addFrontendError(wpsg_translate(
+                            __('Anzahl an Uploads (#1#) in Produkt "#2#" ÃŒberschreitet die maximal mÃ¶gliche Menge an Uploads (#3#).', 'wpsg'),
+                            sizeof($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files']),
+                            $oProduct->getProductName(),
+                            $max_upload,
+                        ));
+
+                        $ok = false;
+
+                    }
+
+                    // Pflichtfeld ÃŒberprÃŒfen
+                    if ($oProduct->getMeta('wpsg_mod_printshop_productupload_mandatory') === '1') {
+
+                        if (sizeof($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files']) == 0) {
+
+                            $this->shop->addFrontendError(wpsg_translate(
+                                __('Sie mÃŒssen mindestens eine Datei zu Produkt "#1#" hochladen.', 'wpsg'),
+                                $oProduct->getProductName()
+                            ));
+
+                            $ok = false;
+
+                        }
+
+                    }
+
+                }
+
+            }
+
+        } // public function checkCheckout(&$state, &$error, &$arCheckout)
+
+        public function order_view_row_before(&$p, $i) {
+
+            $oProduct = wpsg_product::getInstance($p['product_id']);
+            $oOrderProduct = wpsg_order_product::getInstance($p['order_product_id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_set')) === 1) {
+
+                $this->shop->view['wpsg_mod_printshop'] = [
+                    'order_id' => $oOrderProduct->getOrder()->getId(),
+                    'product_index' => $oOrderProduct->getProductIndex(),
+                    'i' => intval($i),
+                    'width' => wpsg_tf($oOrderProduct->getMeta('wpsg_mod_printshop_width')),
+                    'length' => wpsg_tf($oOrderProduct->getMeta('wpsg_mod_printshop_length')),
+                    'price_onepice' => wpsg_tf($oOrderProduct->getMeta('wpsg_mod_printshop_price_onepice')),
+                    'unit_price' => sanitize_text_field($oOrderProduct->getMeta('wpsg_mod_printshop_unit_price')),
+                    'arFiles' => $this->getFiles($oOrderProduct->getOrder()->getId(), $oOrderProduct->getProductIndex())
+                ];
+
+                $this->shop->view['wpsg_mod_printshop']['area'] = round($this->shop->view['wpsg_mod_printshop']['width'] * $this->shop->view['wpsg_mod_printshop']['length'], 2);
+
+                $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/order_view_row.phtml');
+
+            }
+
+        }
+
+        public function mail_row($i, $p) {
+
+            //$this->htmlMail = true;
+
+            $oProduct = wpsg_product::getInstance($p['product_id']);
+            $oOrderProduct = wpsg_order_product::getInstance($p['order_product_id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_set')) === 1) {
+
+                $this->shop->view['wpsg_mod_printshop'] = [
+                    'i' => intval($i),
+                    'width' => wpsg_tf($oOrderProduct->getMeta('wpsg_mod_printshop_width')),
+                    'length' => wpsg_tf($oOrderProduct->getMeta('wpsg_mod_printshop_length')),
+                    'price_onepice' => wpsg_tf($oOrderProduct->getMeta('wpsg_mod_printshop_price_onepice')),
+                    'unit_price' => sanitize_text_field($oOrderProduct->getMeta('wpsg_mod_printshop_unit_price'))
+                ];
+
+                $this->shop->view['wpsg_mod_printshop']['area'] = round($this->shop->view['wpsg_mod_printshop']['width'] * $this->shop->view['wpsg_mod_printshop']['length'], 2);
+
+                if ($this->shop->htmlMail === true)
+                    $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/mail_row_html.phtml');
+                else
+                    $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/mail_row.phtml');
+
+            }
+
+        }
+
+        public function overview_row_before(&$p, $i) {
+
+            $oProduct = wpsg_product::getInstance($p['id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_set')) === 1) {
+
+                $this->shop->view['wpsg_mod_printshop'] = [
+                    'width' => wpsg_tf($p['wpsg_mod_printshop']['width']),
+                    'length' => wpsg_tf($p['wpsg_mod_printshop']['length']),
+                    'price_onepice' => $oProduct->getPrice($p['product_key']),
+                    'unit_price' => sanitize_text_field($oProduct->getMeta('wpsg_mod_printshop_unit_price'))
+                ];
+
+                $this->shop->view['wpsg_mod_printshop']['area'] = round($this->shop->view['wpsg_mod_printshop']['width'] * $this->shop->view['wpsg_mod_printshop']['length'], 2);
+
+                $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/overview_row_before.phtml');
+
+            }
+
+        }
+
+        public function overview_row(&$p, $i) {
+
+            $oProduct = wpsg_product::getInstance($p['id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_productupload_set')) === 1 && wpsg_isSizedArray($p['wpsg_mod_printshop']['files'])) {
+
+                $this->shop->view['wpsg_mod_printshop'] = [
+                    'length' => wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_productupload_length')),
+                    'mandatory' => wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_productupload_mandatory')),
+                    'product_index' => $p['product_index'],
+                    'files' => $p['wpsg_mod_printshop']['files']
+                ];
+
+                $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_printshop/overview_row.phtml');
+
+            }
+
+        }
+
+        public function basket_save_done(&$order_id, &$kunde_id, &$oBasket) {
+
+		    $oOrder = wpsg_order::getInstance($order_id);
+
+		    foreach ($oOrder->getOrderProducts() as $oOrderProduct) {
+
+		        if ($oOrderProduct->getProduct()->getMeta('wpsg_mod_printshop_productupload_set') === '1') {
+
+                    $product_index = $oOrderProduct->getProductIndex();
+
+                    if (wpsg_isSizedArray($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'])) {
+
+                        $path = $this->getUploadPath($order_id, $product_index);
+
+                        foreach ($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'] as $f) {
+
+                            copy($f['tmpnam'], $path.$f['file_name']);
+
+                        }
+
+                    }
+
+                }
+
+            }
+
+        }
+
+		public function calculation_addProduct(&$product_data, $ses_data) {
+			
+			if (isset($ses_data['wpsg_mod_printshop'])) {
+				
+				$product_data['set'] = $ses_data['wpsg_mod_printshop']['price'];
+				$product_data['bruttonetto'] = $this->shop->getBackendTaxview();
+				 
+			}
+			
+		}
+
+        public function renderProdukt_templateSelect(&$produkt_data, &$template_file) {
+
+            $oProduct = wpsg_product::getInstance($produkt_data['id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_set')) === 1) {
+
+                $template_file = WPSG_PATH_VIEW.'/mods/mod_printshop/producttemplate.phtml';
+
+            }
+
+        }
+
+        public function calculation_saveProduct_after(&$oCalculation, $calc_product, &$db_product_data, $finish_order) {
+
+		    $oProduct = wpsg_product::getInstance($calc_product['product_id']);
+
+            if (intval($oProduct->getMeta('wpsg_mod_printshop_set')) === 1) {
+
+		        $ac = $_SESSION['wpsg']['basket'][$calc_product['product_index']]['wpsg_mod_printshop']??null;
+
+		        if (is_null($ac)) throw new \wpsg\Exception(__('Keine Daten zum speichern des FlÃ€chenproduktes'));
+
+		        if (!isset($ac['price']) || !isset($ac['width']) || !isset($ac['length'])) throw new \wpsg\Exception(__('Es fehlen Daten zum speichern des FlÃ€chenproduktes'));
+
+                $oOrderProduct = wpsg_order_product::getInstance(intval($calc_product['order_product_id']));
+
+                $oOrderProduct->setMeta('wpsg_mod_printshop_price', wpsg_tf($ac['price']));
+                $oOrderProduct->setMeta('wpsg_mod_printshop_width', wpsg_tf($ac['width']));
+                $oOrderProduct->setMeta('wpsg_mod_printshop_length', wpsg_tf($ac['length']));
+                $oOrderProduct->setMeta('wpsg_mod_printshop_price_onepice', wpsg_tf($oProduct->getPrice($calc_product['product_key'])));
+                $oOrderProduct->setMeta('wpsg_mod_printshop_unit_price', sanitize_text_field($oProduct->getMeta('wpsg_mod_printshop_unit_price')));
+
+            }
+
+        }
+
+        public function downloadFileRedirect() {
+
+            $product_index = intval($_REQUEST['product_index']);
+            $file_index = intval($_REQUEST['file_index']);
+
+		    $file = wpsg_getStr($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'][$file_index]['tmpnam']);
+
+		    if (file_exists($file)) {
+
+		        wpsg_header::AUTO(
+		            $file,
+                    wpsg_getStr($_SESSION['wpsg']['basket'][$product_index]['wpsg_mod_printshop']['files'][$file_index]['file_name'])
+                );
+
+            } else {
+
+		        $this->shop->addFrontendError(__('Datei konnte nicht gefunden werden.', 'wpsg'));
+		        $this->shop->redirect($this->shop->getURL(wpsg_ShopController::URL_BASKET));
+
+            }
+
+        }
+
+        /**
+         * @param int $order_id
+         * @param int $product_index
+         * @param bool $create
+         * @return string
+         */
+        public function getUploadPath($order_id, $product_index, $create = true) {
+
+            $path = WPSG_PATH_UPLOADS.'wpsg_mod_printshop/files/'.$order_id.'/'.$product_index.'/';
+
+            if ($create) $this->shop->protectDirectory($path);
+
+            return $path;
+
+        }
+
+        public function getFiles($order_id, $product_index) {
+
+            $arFiles = [];
+            $path = $this->getUploadPath($order_id, $product_index, false);
+
+            if (file_exists($path)) {
+
+                foreach (scandir($path) as $f) {
+
+                    if (!in_array($f, ['.', '..', '.htaccess'])) {
+
+                        $arFiles[] = $path.$f;
+
+                    }
+
+                }
+
+            }
+
+		    return $arFiles;
+
+        }
+
+		/* Statische Funktionen */
+
+		public static function getInstance() {
+			
+			if (!isset(static::$instance)) static::$instance = new static;
+			
+			return static::$instance;
+			
+		}
+
+	}
+    
+    
Index: /views/css/frontend.css
===================================================================
--- /views/css/frontend.css	(revision 7705)
+++ /views/css/frontend.css	(revision 7706)
@@ -77,4 +77,7 @@
 .wpsg_basket .wpsg_refreshbutton, .wpsg_basketbutton { float:left; padding:0.75em 1em; }
 .wpsg_basket .wpsg_basket_weiter_shoppen {background:#1a1a1a none repeat scroll 0 0; border:0 none; border-radius:2px; color:#fff; font-weight:700; line-height:1; text-transform:uppercase; padding:0.85em 0.875em 0.78em;}
+.wpsg_basket .product_action_printshop .label { align-self:flex-start; }
+.wpsg_basket .product_action_printshop .files ul li { list-style:none; display:flex; align-items:center; justify-content:flex-end; }
+.wpsg_basket .product_action_printshop .files ul li img { margin-left:5px; cursor:pointer; }
 
 /* Checkout + Request*/
@@ -544,3 +547,3 @@
 .wpsg_produkt_wrapper2 .wpsg_productimages { margin-right:0px !important; }
 .wpsg_produkt_wrapper2 .bigimg img { margin:0 15px 15px 15px; width:100px; height:auto; float:left;  }
- 
+
Index: /views/mods/mod_paypalapi/settings_edit.phtml
===================================================================
--- /views/mods/mod_paypalapi/settings_edit.phtml	(revision 7705)
+++ /views/mods/mod_paypalapi/settings_edit.phtml	(revision 7706)
@@ -7,4 +7,5 @@
 ?>
 
+<?php echo wpsg_drawForm_Select('wpsg_mod_paypalapi_version', __('API Version', 'wpsg'), ['v1' => 'V1', 'v2' => 'V2'], $this->get_option('wpsg_mod_paypalapi_version'), []); ?>
 <?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_clientid', __('Client ID', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_clientid'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_clientid', 'hint' => wpsg_translate('nohspc_'.__('Erhalten Sie im <a target="_blank" href="#1#">PayPal Developer Interface</a>.', 'wpsg'), 'https://developer.paypal.com/'))); ?>
 <?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_secret', __('Secret', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_secret'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_secret', 'hint' => wpsg_translate('nohspc_'.__('Erhalten Sie im <a target="_blank" href="#1#">PayPal Developer Interface</a>.', 'wpsg'), 'https://developer.paypal.com/'))); ?>
@@ -99,7 +100,19 @@
 <?php echo wpsg_drawForm_Textarea('wpsg_mod_paypalapi_plus_hint', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_plus_hint'), array('help' => 'wpsg_shippay_hint')); ?>
   
-<script type="text/javascript">/* <![CDATA[ */
+<script>
 
 	jQuery(document).ready(function() {
+
+	    var wpsg_mod_paypalapi_version = jQuery('#wpsg_mod_paypalapi_version').val();
+
+	    jQuery('#wpsg_mod_paypalapi_version').on('change', function() {
+
+	        if (jQuery(this).val() === 'v2' && wpsg_mod_paypalapi_version === 'v1') {
+
+	            alert('<?php echo __('Beim Wechseln von V1 auf V2 sollte eine neue App im PayPal Developer Intervace angelegt werden.', 'wpsg'); ?>');
+
+            }
+
+        });
 
 		jQuery('#wpsg_mod_paypalapi_plus_aktiv').on('change', function() {
@@ -162,3 +175,3 @@
 	} );
 
-/* ]]> */</script>
+</script>
Index: /views/mods/mod_printshop/basket_row.phtml
===================================================================
--- /views/mods/mod_printshop/basket_row.phtml	(revision 7706)
+++ /views/mods/mod_printshop/basket_row.phtml	(revision 7706)
@@ -0,0 +1,48 @@
+<?php
+
+    declare(strict_types=1);
+
+    /**
+     * User: Daschmi (daschmi@daschmi.de)
+     * Date: 13.02.2020
+     * Time: 06:25
+     */
+
+    $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_printshop">
+	<div class="label">
+
+        <?php echo __("Bestellupload", "wpsg"); ?><br />
+
+        <input type="file" name="wpsg_mod_printshop[<?php echo $view['product_index']; ?>][]" <?php echo (($view['length'] > 1)?'multiple':''); ?> />
+
+    </div>
+    <div class="files">
+
+        <?php if (wpsg_isSizedArray($view['files'])) { ?>
+
+            <ul>
+                <?php foreach ($view['files'] as $file_index => $f) { ?>
+                <li>
+                    <input type="checkbox" name="wpsg_mod_printshop[<?php echo $view['product_index'] ?>][delete_file][]" value="<?php echo $file_index; ?>" class="checkbox" style="display:none;" />
+                    <a href="<?php echo $this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_printshop', 'downloadFile', ['product_index' => $view['product_index'], 'file_index' => $file_index], false); ?>" target="_blank">
+                        <?php echo $f['file_name']; ?>
+                    </a>
+                    <img
+                            onclick="event.target.parentElement.querySelector('.checkbox').checked = 'checked'; event.target.parentElement.style.display = 'none'; return false"
+                            class="delete" title="<?php echo __('Datei entfernen.', 'wpsg'); ?>" src="<?php echo WPSG_URL; ?>views/gfx/bin_x.png" alt="<?php echo __('LÃ¶schen', 'wpsg'); ?>" alt="X" />
+                </li>
+                <?php } ?>
+            </ul>
+
+        <?php } else { ?>
+
+            <p><?php echo __('Noch keine Uploads durchgefÃŒhrt.', 'wpsg'); ?></p>
+
+        <?php } ?>
+
+    </div>
+</div>
Index: /views/mods/mod_printshop/basket_row_before.phtml
===================================================================
--- /views/mods/mod_printshop/basket_row_before.phtml	(revision 7706)
+++ /views/mods/mod_printshop/basket_row_before.phtml	(revision 7706)
@@ -0,0 +1,34 @@
+<?php
+
+    declare(strict_types=1);
+
+    /**
+     * User: Daschmi (daschmi@daschmi.de)
+     * Date: 13.02.2020
+     * Time: 06:25
+     */
+
+    $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_price_onepice">
+	<div class="title">
+        <?php echo wpsg_translate(__("Preis je #1#", "wpsg"), $view['unit_price'].'Â²'); ?>
+    </div>
+    <div class="price">
+        <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency').'/'.$view['unit_price'].'Â²'); ?>
+    </div>
+</div>
+
+<div class="product_action product_action_area">
+    <div class="title">
+        <span class="label"><?php echo __("FlÃ€che", "wpsg"); ?></span>
+        <span class="rect">
+            (<?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?>)
+        </span>
+    </div>
+    <div class="price">
+        <?php echo wpsg_ff($view['area'], $view['unit_price'].'Â²'); ?>
+    </div>
+</div>
Index: /views/mods/mod_printshop/mail_row.phtml
===================================================================
--- /views/mods/mod_printshop/mail_row.phtml	(revision 7706)
+++ /views/mods/mod_printshop/mail_row.phtml	(revision 7706)
@@ -0,0 +1,18 @@
+<?php
+
+    declare(strict_types=1);
+
+    /**
+     * Template fÃŒr die Integration des FlÃ€chenprodukts in die Text Mail im Bereich der Produkte
+     */
+
+    $view = $this->view['wpsg_mod_printshop'];
+
+    // 150,55 m x 1,5 m = 225,83 mÂ²
+    $strOut = wpsg_ff($view['width'], $view['unit_price'], true, 0).' x '.wpsg_ff($view['length'], $view['unit_price'], true, 0).' = '.wpsg_ff($view['area'], $view['unit_price'].'Â²');
+
+    // (1 mÂ² â
+ 1,00 EUR)
+    $strOut .= '('.wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency').' / '.$view['unit_price'].'Â²').')';
+
+    echo wpsg_pad_left(__('GrÃ¶Ãe:', 'wpsg').' ', 12); ?><?php echo $strOut; ?>
Index: /views/mods/mod_printshop/mail_row_html.phtml
===================================================================
--- /views/mods/mod_printshop/mail_row_html.phtml	(revision 7706)
+++ /views/mods/mod_printshop/mail_row_html.phtml	(revision 7706)
@@ -0,0 +1,19 @@
+<?php
+
+    declare(strict_types=1);
+
+    /**
+     * Template fÃŒr die Integration des FlÃ€chenprodukts in die HTML Mails im Bereich Produkt
+     */
+
+    $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<tr class="productrow productrow2 <?php echo ((($view['i'] % 2) == 0)?'productrow_odd':'productrow_even'); ?>">
+    <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_pos">&nbsp;</td>
+    <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_productvars_value" colspan="<?php echo ((sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'5':'4'); ?>">
+        <?php echo __('GrÃ¶Ãe', 'wpsg'); ?>:&nbsp;<?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?> = <?php echo wpsg_ff($view['area'], $view['unit_price'].'Â²'); ?>
+        (1 <?php echo $view['unit_price'] ?>Â² &cong; <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency')); ?>)
+    </td>
+</tr>
Index: /views/mods/mod_printshop/order_view_row.phtml
===================================================================
--- /views/mods/mod_printshop/order_view_row.phtml	(revision 7706)
+++ /views/mods/mod_printshop/order_view_row.phtml	(revision 7706)
@@ -0,0 +1,46 @@
+<?php
+
+    declare(strict_types=1);
+
+    /**
+     * User: Daschmi (daschmi@daschmi.de)
+     * Date: 13.02.2020
+     * Time: 06:25
+     */
+
+    $view = $this->view['wpsg_mod_printshop'];
+    $arCalculation = $this->view['arCalculation'];
+
+?>
+
+<tr class="wpsg_<?php echo (($view['i'] % 2 == 0)?'odd':'even'); ?> wpsg_areaproduct">
+    <td class="wpsg_cell_name"></td>
+    <td class="wpsg_cell_value" colspan="<?php echo ((sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?4:3); ?>">
+
+        <?php echo __('GrÃ¶Ãe', 'wpsg'); ?>
+        <?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?> = <?php echo wpsg_ff($view['area'], $view['unit_price'].'Â²'); ?>
+        (1 <?php echo $view['unit_price'] ?>Â² &cong; <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency')); ?>)
+
+    </td>
+</tr>
+
+<?php if (wpsg_isSizedArray($view['arFiles'])) { ?>
+
+    <tr class="wpsg_<?php echo (($view['i'] % 2 == 0)?'odd':'even'); ?> wpsg_areaproduct">
+        <td class="wpsg_cell_name"></td>
+        <td class="wpsg_cell_value" colspan="<?php echo ((sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?4:3); ?>">
+
+            <?php $arFileLinks = []; foreach ($view['arFiles'] as $f) {
+
+
+                $url = wpsg_admin_url('Order', 'ajax', ['do' => 'download', 'mod' => 'wpsg_mod_printshop', 'noheader' => '1', 'order_id' => $view['order_id'], 'product_index' => $view['product_index'], 'file' => rawurlencode(basename($f))]);
+
+                $arFileLinks[] = '<a href="'.$url.'" target="_blank">'.basename($f).'</a>';
+
+            } echo implode(', ', $arFileLinks); ?>
+
+        </td>
+    </tr>
+
+
+<?php }
Index: /views/mods/mod_printshop/overview_row.phtml
===================================================================
--- /views/mods/mod_printshop/overview_row.phtml	(revision 7706)
+++ /views/mods/mod_printshop/overview_row.phtml	(revision 7706)
@@ -0,0 +1,38 @@
+<?php
+
+    declare(strict_types=1);
+
+    /**
+     * User: Daschmi (daschmi@daschmi.de)
+     * Date: 13.02.2020
+     * Time: 06:25
+     */
+
+    $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_printshop">
+    <div class="label">
+
+        <?php echo __("Uploads", "wpsg"); ?><br />
+
+    </div>
+    <div class="files">
+
+        <?php if (wpsg_isSizedArray($view['files'])) {
+
+            $arFiles = [];
+
+            foreach ($view['files'] as $file_index => $f) {
+
+                $arFiles[] = '<a href="'.$this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_printshop', 'downloadFile', ['product_index' => $view['product_index'], 'file_index' => $file_index], false).'" target="_blank">'.$f['file_name'].'</a>';
+
+            }
+
+            echo implode(', ', $arFiles);
+
+        } ?>
+
+    </div>
+</div>
Index: /views/mods/mod_printshop/overview_row_before.phtml
===================================================================
--- /views/mods/mod_printshop/overview_row_before.phtml	(revision 7706)
+++ /views/mods/mod_printshop/overview_row_before.phtml	(revision 7706)
@@ -0,0 +1,34 @@
+<?php
+
+    declare(strict_types=1);
+
+    /**
+     * User: Daschmi (daschmi@daschmi.de)
+     * Date: 13.02.2020
+     * Time: 06:25
+     */
+
+    $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_price_onepice">
+	<div class="title">
+        <?php echo wpsg_translate(__("Preis je #1#", "wpsg"), $view['unit_price'].'Â²'); ?>
+    </div>
+    <div class="price">
+        <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency').'/'.$view['unit_price'].'Â²'); ?>
+    </div>
+</div>
+
+<div class="product_action product_action_area">
+    <div class="title">
+        <span class="label"><?php echo __("FlÃ€che", "wpsg"); ?></span>
+        <span class="rect">
+            (<?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?>)
+        </span>
+    </div>
+    <div class="price">
+        <?php echo wpsg_ff($view['area'], $view['unit_price'].'Â²'); ?>
+    </div>
+</div>
Index: /views/mods/mod_printshop/product.phtml
===================================================================
--- /views/mods/mod_printshop/product.phtml	(revision 7706)
+++ /views/mods/mod_printshop/product.phtml	(revision 7706)
@@ -0,0 +1,227 @@
+<?php
+	
+	declare(strict_types=1);
+	
+	/**
+	 * User: Daschmi (daschmi@daschmi.de)
+	 * Date: 14.01.2020
+	 * Time: 10:04
+	 */ 
+    
+    $ap = $this->view['ap'];
+    
+    $pi = $this->view['product_index'];
+	
+    /** @var wpsg_product $oProduct */
+    $oProduct = $this->view['oProduct'];
+
+    if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA) {
+
+        $width = '';
+        $length = '';
+
+    } else if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA_SELECT) {
+		
+		$arWidth = [];
+		$arLength = [];
+		
+		for ($i = intval($ap['width_min']); $i <= intval($ap['width_max']); $i += intval($ap['width_step'])) {
+		
+			$arWidth[] = $i;
+			
+		}
+		
+		for ($i = intval($ap['length_min']); $i <= intval($ap['length_max']); $i += intval($ap['length_step'])) {
+			
+			$arLength[] = $i;
+			
+		}
+		
+		$width = $arWidth[0];
+		$length = $arLength[0];
+		
+	} else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM) {
+
+		$width = $ap['width'];
+		$length = '';
+		
+	} else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM_SELECT) {
+		
+		for ($i = intval($ap['length_min']); $i <= intval($ap['length_max']); $i += intval($ap['length_step'])) {
+			
+			$arLength[] = $i;
+			
+		}
+		
+		$width = $ap['width'];
+		$length = $arLength[0];
+		
+	}
+	
+?>
+
+<div class="row">
+	
+	<input type="hidden" name="wpsg[insertAreaProduct]" value="1" />
+	
+	<?php if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA) { ?>
+	
+		<div class="form-group">
+			<label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+			<input type="text" name="wpsg[width]" value="<?php echo $width; ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_width" placeholder="<?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?>" required="required" />
+		</div>
+		
+		<br />
+		
+		<div class="form-group">
+			<label for="product_<?php echo $pi; ?>_length"><?php echo wpsg_translate(__('LÃ€nge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+			<input type="text" name="wpsg[length]" value="<?php echo $length; ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_length" placeholder="<?php echo wpsg_translate(__('LÃ€nge in #1#', 'wpsg'), $ap['price_unit']); ?>" required="required" />
+		</div>
+	
+	<?php } else if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA_SELECT) { ?>
+
+		<div class="form-group">
+			<label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite x LÃ€nge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+			<div class="width_length_wrap">
+				
+				<select name="wpsg[width]" class="form-control wpsg_mod_printshop_change"  id="product_<?php echo $pi; ?>_width">
+					<?php foreach ($arWidth as $w) { ?>
+						<option value="<?php echo $w; ?>" <?php echo (($w === $width)?'selected="selected"':''); ?>><?php echo $w; ?></option>
+					<?php } ?>
+				</select>
+				
+				<span>x</span>
+				
+				<select name="wpsg[length]" class="form-control wpsg_mod_printshop_change"  id="product_<?php echo $pi; ?>_length">
+					<?php foreach ($arLength as $l) { ?>
+						<option value="<?php echo $l; ?>" <?php echo (($l === $length)?'selected="selected"':''); ?>><?php echo $l; ?></option>
+					<?php } ?>
+				</select>
+				
+			</div>
+		</div>
+				
+	<?php } else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM) { ?>
+
+		<div class="form-group">
+			<label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+			<input name="wpsg[width]" type="text" value="<?php echo wpsg_ff($width, false, true, 0); ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_width" placeholder="<?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?>" disabled="disabled" readonly="readonly" />
+		</div>
+
+		<br />
+
+		<div class="form-group">
+			<label for="product_<?php echo $pi; ?>_length"><?php echo wpsg_translate(__('LÃ€nge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+			<input name="wpsg[length]" type="text" value="<?php echo wpsg_ff($length, false, true, 0); ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_length" placeholder="<?php echo wpsg_translate(__('LÃ€nge in #1#', 'wpsg'), $ap['price_unit']); ?>" required="required" />
+		</div>
+		
+	<?php } else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM_SELECT) { ?>
+
+		<div class="form-group">
+			<label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+			<input type="text" value="<?php echo $width; ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_width" placeholder="<?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?>" disabled="disabled" readonly="readonly" />
+		</div>
+
+		<br />
+
+		<div class="form-group">
+			<label for="product_<?php echo $pi; ?>_length"><?php echo wpsg_translate(__('LÃ€nge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+			<select name="wpsg[length]" class="form-control wpsg_mod_printshop_change"  id="product_<?php echo $pi; ?>_length">
+				<?php foreach ($arLength as $l) { ?>
+					<option value="<?php echo $l; ?>" <?php echo (($l === $length)?'selected="selected"':''); ?>><?php echo $l; ?></option>
+				<?php } ?>
+			</select>
+		</div>
+		
+	<?php } ?>
+		
+	<br /> 
+	
+	<div class="form-group">
+		<label for="product_<?php echo $pi; ?>_price"><?php echo wpsg_translate(__('StÃŒckpreis in #1#', 'wpsg'), $this->get_option('wpsg_currency')); ?></label>
+		<input type="text" value="" class="form-control" id="product_<?php echo $pi; ?>_price" placeholder="" disabled="disabled" />
+	</div>
+	
+	<br />
+	
+</div>
+
+<style>
+	
+	.width_length_wrap > select { width:75px; }
+	.width_length_wrap > select:first-child { margin-right:5px; }
+	.width_length_wrap > select:last-child { margin-left:5px; }
+	select.form-control { width:100%; }
+	
+</style>
+
+<script>
+
+	if (typeof wpsg_mod_printshop_calculate !== "function") {
+	
+		function wpsg_mod_printshop_calculate(mode, price, product_index) {
+
+			var error = 0;
+
+			var jqWidth = jQuery('#product_' + product_index + '_width');
+			var jqLength = jQuery('#product_' + product_index + '_length');
+
+			var width = parseFloat(jqWidth.val().replace(',', '.'));
+			var length = parseFloat(jqLength.val().replace(',', '.'));
+	
+			if (isNaN(width) || width <= 0) { jqWidth.addClass('wpsg_error'); error ++; }
+			else jqWidth.removeClass('wpsg_error');
+
+			if (isNaN(length) || length <= 0) { jqLength.addClass('wpsg_error'); error ++; }
+			else jqLength.removeClass('wpsg_error');
+
+			if (error === 0) {
+
+				var price = wpsg_round(width * length, 2) * price;
+
+				jQuery('#product_' + product_index + '_price').val(wpsg_numberformat(wpsg_round(price, 2), 2, ',', '.')).removeClass('wpsg_error');
+				
+			} else {
+				
+				jQuery('#product_' + product_index + '_price').val('<?php echo __('Keine Berechnung mÃ¶glich', 'wpsg'); ?>').addClass('wpsg_error');
+				
+			}
+					
+			return error;
+			
+		}
+		
+	}
+		
+	jQuery(document).ready(function() {
+	
+		jQuery('#wpsg_produktform_<?php echo $pi; ?> .wpsg_mod_printshop_input, #wpsg_produktform_<?php echo $pi; ?> .wpsg_menge').on('input', function() {
+
+			wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>);
+			
+		});
+
+		jQuery('#wpsg_produktform_<?php echo $pi; ?> .wpsg_mod_printshop_change').on('change', function() {
+
+			wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>);
+			
+		});
+		
+		jQuery('.wpsg_add_basket_<?php echo $pi; ?>').on('click', function(event) {
+			
+			if (wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>) > 0) {
+
+				event.stopPropagation();
+				event.preventDefault();
+				
+				return false;
+				
+			}
+			
+		});
+
+		wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>);
+		
+	});
+	
+</script>
Index: /views/mods/mod_printshop/producttemplate.phtml
===================================================================
--- /views/mods/mod_printshop/producttemplate.phtml	(revision 7706)
+++ /views/mods/mod_printshop/producttemplate.phtml	(revision 7706)
@@ -0,0 +1,449 @@
+<?php
+
+	/*
+	 * Template fÃŒr FlÃ€chenprodukte im Frontend
+	 * Angepasstes standard.phtml
+	 */
+	
+	/** @var wpsg_product $oProduct */
+	$oProduct = $this->view['oProduct'];
+	
+	$ap = [
+		'set' => intval($oProduct->getMeta('wpsg_mod_printshop_set')),
+		'mode' => intval($oProduct->getMeta('wpsg_mod_printshop_mode')),
+		'price_unit' => sanitize_text_field($oProduct->getMeta('wpsg_mod_printshop_unit_price')),
+		'width' => wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_width')),
+		'width_step' => intval($oProduct->getMeta('wpsg_mod_printshop_width_step')),
+		'width_min' => intval($oProduct->getMeta('wpsg_mod_printshop_width_min')),
+		'width_max' => intval($oProduct->getMeta('wpsg_mod_printshop_width_max')),
+		'length_step' => intval($oProduct->getMeta('wpsg_mod_printshop_length_step')),
+		'length_min' => intval($oProduct->getMeta('wpsg_mod_printshop_length_min')),
+		'length_max' => intval($oProduct->getMeta('wpsg_mod_printshop_length_max'))
+	];
+	
+	$this->view['ap'] = $ap;
+
+?>
+
+<div class="wpsg_produkt_wrapper">
+
+	<input type="hidden" name="wpsg_post_id" value="<?php echo get_the_ID(); ?>" />
+	<input type="hidden" name="titleDisplayed" value="<?php echo $this->titleDisplayed; ?>" />
+
+	<div class="wpsg_produkt wpsg_product_name">
+
+		<?php if (!$this->titleDisplayed) { ?>
+			<h1 itemprop="name" class="wpsg_producttitle"><?php echo $this->getProductName($this->view['data']['id']); ?></h1>
+			<h2 itemprop="detailname" class="wpsg_productdetailtitle"><?php echo $this->view['data']['detailname']; ?></h2>	
+		<?php } ?>
+
+		<?php $this->callMods('product_top_afterheadline', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?>
+
+	</div>
+
+	<?php $this->callMods('product_top', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?>
+
+	<div itemscope itemtype="http://schema.org/Product" class="wpsg_produkt wpsg_produkt_<?php echo $this->view['data']['id']; ?>">
+
+		<?php /* Block fÃŒr die Produktbilder START */ ?>
+		<?php 
+		
+			/* Das ist das primÃ€re Anzeigebild des Produktes (AttachmentID) */
+			$arAttachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']);
+		
+			/* Array mit allen AttachmentIDs der Produktbilder */
+			$arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']);
+		
+		?>
+
+		<?php if (wpsg_isSizedArray($arAttachmentIDsAll)) { ?>
+		<div class="wpsg_productimages">
+
+			<div class="wpsg_produkt_produktbilder">
+
+				<?php if (sizeof($arAttachmentIDsAll) > 0) { for ($i = 0; $i < sizeof($arAttachmentIDsAll); $i ++) { ?>
+					
+					<?php /* URL fÃŒr die Lightbox */ ?>
+					<?php $att = wp_get_attachment_image_src($arAttachmentIDsAll[$i], array(800, 600), false); ?>
+					
+					<a <?php if ($arAttachmentIDsAll[$i] != $arAttachmentID) echo 'style="display:none;"'; ?> rel="gallery-wpsg-<?php echo $this->getTemplateIndex(); ?>" title="<?php echo $this->getProductName($this->view['data']['id']); ?>" href="<?php echo $att[0]; ?>" class="thickbox">
+
+						<?php echo wp_get_attachment_image($arAttachmentIDsAll[$i], array(300, 300), false, array()); ?>
+						
+					</a>
+					
+				<?php } } ?>
+
+			</div>
+
+		</div>
+		<?php } ?>
+		<?php /* Block fÃŒr die Produktbilder ENDE */ ?>
+
+		<?php if ($this->get_option('wpsg_showArticelnumber') == '1') { ?>
+		<div class="wpsg_artikelnummer">
+			<?php echo __('Artikelnummer', 'wpsg'); ?>: <span class="wpsg_anr"><?php echo wpsg_hspc($this->view['data']['anr']); ?></span><br />
+			<?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_ean'))) {?>
+				<?php echo __('EAN','wpsg');?>:<span class="wpsg_ean"><?php echo wpsg_hspc($this->view['data']['ean']); ?></span><br />
+			<?php } ?>
+			<?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_gtin'))) {?>
+				<?php echo __('GTIN','wpsg');?>:<span class="wpsg_gtin"><?php echo wpsg_hspc($this->view['data']['gtin']); ?></span><br />
+			<?php }?></div>
+		<?php } ?>
+
+		<?php /* Abfrage Preisanzeige nur fÃŒr eingeloggte User aktiv und User eingeloggt START*/ ?>
+		<?php if ($this->view['oProduct']->canDisplayPrice()) { ?>
+
+			<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="wpsg_produkt_preis">
+
+				<meta itemprop="priceCurrency" content="<?php echo $this->get_option('wpsg_currency'); ?>" />
+
+				<?php echo wpsg_translate(__('Preis je #1#Â²:', 'wpsg'), $ap['price_unit']); ?>
+
+				<?php $oldPrice = $this->view['oProduct']->getOldPrice();  ?>
+				
+				<?php if ($oldPrice !== false && $oldPrice != $this->view['oProduct']->getPrice($this->view['data']['product_key'])) { ?>
+					<span class="wpsg_mod_productview_price wpsg_mod_productview_current"><?php echo wpsg_ff($this->view['oProduct']->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+					<span class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></span>
+				<?php } else { ?>
+					<span class="wpsg_mod_productview_price"><?php echo wpsg_ff($this->view['oProduct']->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+				<?php } ?>
+
+			</div>
+
+			<?php if ($this->get_option('wpsg_kleinunternehmer')) { /* Kleinunternehmerregelung aktiviert START */ ?>
+
+				<div class="wpsg_produkt_preishinweis">
+					<?php echo wpsg_translate(__('#2# zzgl. #1#', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>', '<a href="#kkhint" title="'.wpsg_hspc($this->get_option('wpsg_kleinunternehmer_text')).'">Endpreis</a>'); ?>
+				</div>
+
+			<?php } else { /* Kleinunternehmerregelung aktiviert ENDE */ ?>
+
+				<div class="wpsg_produkt_preishinweis">
+					<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { /* Frontend = NETTO Preise */ ?>
+						<?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */?>
+							
+							<?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
+								<?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und <a href="#3#">ab #2# â¬ versandkostenfrei</a>)', 'wpsg'), 
+									wpsg_ff($this->view['data']['mwst_value']), 
+									wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')),
+									$this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)
+								); ?>
+							<?php } else { ?>
+								<?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?>
+							<?php } ?>
+							
+						<?php } else { ?>
+							<?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
+						<?php }?>
+					<?php } else { /* Frontend = BRUTTO Preise */ ?>
+						<?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */ ?>
+							
+							<?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
+								<?php echo wpsg_translate(__('(inkl. #1#% MwSt. und <a href="#3#">ab #2# â¬ versandkostenfrei</a>)', 'wpsg'),
+									wpsg_ff($this->view['data']['mwst_value']),
+									wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')),
+									$this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)
+								); ?>
+							<?php } else { ?>
+								<?php echo wpsg_translate(__('(inkl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?>
+							<?php } ?> 
+							
+						<?php } else { ?>
+							<?php echo wpsg_translate(__('(inkl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
+						<?php }?>
+					<?php } ?>
+				</div>
+
+			<?php } ?>
+			
+		<?php } else {?>
+
+			<?php echo wpsg_translate(__('Die Produktpreise werden nur eingeloggten Benutzern angezeigt. Loggen Sie sich <a href="'.$this->getURL(wpsg_ShopController::URL_PROFIL).'">hier</a> bitte ein, um zu bestellen.')); ?>
+
+		<?php }?>
+		<?php /* Abfrage Preisanzeige nur fÃŒr eingeloggte User aktiv und User eingeloggt ENDE */ ?>
+
+		<div itemprop="description" class="wpsg_produkt_shortdescription">
+		
+			<span><?php echo $this->view['data']['shortdesc']; ?></span>
+			
+		</div>
+
+		<div class="wpsg_clear"></div>
+
+		<?php /* Lagerbestand START*/?>
+		<?php if ($this->hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProduct') == '1') { ?>
+		
+		<div class="wpsg_mod_produktindex_stock">
+		
+			<?php if (($this->view['data']['stock']) > '0') {?>		
+				
+                <label><?php echo __('Lagerbestand', 'wpsg'); ?></label>
+                <?php echo wpsg_translate(__('#1# Artikel auf Lager','wpsg'), $this->view['data']['stock']);  ?>
+			
+			<?php } else { ?>
+			 
+			 	<label><?php echo wpsg_translate(__('', 'wpsg')); ?></label>
+			
+			<?php } ?>	
+		
+		</div>
+		<?php } ?>
+		<?php /* Lagerbestand ENDE*/?>
+
+		<?php /* FÃŒllmengenanzeige START */ ?>
+		<?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?>
+		
+			<div class="wpsg_produkt_fuellmenge">
+			
+				<?php if (($this->view['data']['fmenge']) > '0') { ?>
+				
+					<span class="label label_fuellmenge"><?php echo wpsg_translate(__('FÃŒllmenge:', 'wpsg')); ?></span>
+					
+					<?php echo wpsg_translate(__('#1# (#2# / #3#)', 'wpsg'),							
+						'<span class="wpsg_fmenge">'.wpsg_ff($this->view['data']['fmenge'], '', true).'</span> '.$this->view['data']['feinheit'],
+						'<span class="fmenge_preis">'.wpsg_ff($this->view['data']['fmenge_preis'], $this->get_option('wpsg_currency')).'</span> ',
+						wpsg_ff($this->get_option('wpsg_mod_fuellmenge_bezug'), $this->view['data']['feinheit'])
+					); ?>
+					
+				<?php } else { ?>
+				
+					<label><?php echo wpsg_translate(__('', 'wpsg')); ?></label>
+					
+				<?php } ?>
+				
+			</div>
+
+		<?php } ?>
+		<?php /* FÃŒllmengenanzeige ENDE */ ?>
+
+		<?php /* Gewichtsanzeige START */ ?>
+		<?php if ($this->hasMod('wpsg_mod_weight') && $this->get_option('wpsg_mod_weight_showProduct') === '1') { ?>
+		<div class="wpsg_mod_weight_produkt">
+			
+			<?php if (($this->view['data']['weight']) > '0') { ?>
+				<span class="label label_weight"><?php echo wpsg_translate(__('Gewicht:', 'wpsg')); ?></span>
+				<?php echo wpsg_translate(__('#1# #2#', 'wpsg'), '<span class="wpsg_weight" id="weight_'.$this->view['data']['id'].'">'.wpsg_ff($this->view['data']['weight']).'</span>', $this->get_option('wpsg_mod_weight_unit')); ?>
+			<?php } else { ?>
+				<label><?php wpsg_translate(__('', 'wpsg'))?></label>
+			<?php } ?>
+		</div>
+		<?php } ?>
+		<?php /* Gewichtsanzeige ENDE */ ?>
+
+		<?php /* Lieferzeit Anzeige START */ ?>
+		<?php if ($this->hasMod('wpsg_mod_deliverytime') && $this->get_option('wpsg_mod_deliverytime_show_product') == '1') { ?>
+
+			<?php /* Produkt nur im Store, nicht im Onlineshop vorhanden */ ?>
+			<?php if ($this->callMod('wpsg_mod_deliverytime', 'isStoreProduct', array($this->view['data']['product_key']))) { ?>
+	
+				<div class="wpsg_product_only_store"><?php echo __($this->callMod('wpsg_mod_deliverytime', 'displayStoreText', array($this->view['data']['product_key']))); ?></div>
+	
+				<?php $stl = 0; $stl = $this->callMod('wpsg_mod_deliverytime', 'displayStoreLink', array($this->view['data']['product_key'])) ?>
+				<?php if (wpsg_isSizedInt($stl)) { ?>
+					
+					&nbsp;<a href="<?php echo get_permalink($stl); ?>"><?php echo __('So erreichen Sie uns.'); ?></a>
+					
+				<?php } ?>
+	
+			<?php } else { ?>				
+	
+				<?php $strDelayNote = $this->callMod('wpsg_mod_deliverytime', 'displayDelayTime', array($this->view['data']['product_key'])); ?>
+				<?php if (wpsg_isSizedString($strDelayNote)) { ?>
+						
+					<div class="wpsg_mod_deliverytime_offline">
+					
+						<div class="wpsg_mod_deliverytime_delay"><?php echo wpsg_hspc($strDelayNote); ?></div>
+					
+					</div>
+						
+				<?php } else { ?>
+				
+				<div class="wpsg_mod_deliverytime">
+					<span class="label label_deliverytime"><?php echo wpsg_translate(__('Lieferzeit:', 'wpsg')); ?></span>
+					<?php echo $this->callMod('wpsg_mod_deliverytime', 'displayDeliveryTime', array($this->view['data']['product_key'])); ?>
+				</div>	
+						
+				<?php } ?>
+	
+			<?php } ?>
+			
+		<?php } ?>
+		<?php /* Lieferzeit Anzeige ENDE */ ?>
+
+		<?php /* Produktkurzbeschreibung START */ ?>
+		<div class="wpsg_product_informationarea">
+
+			<?php if (strlen(trim($this->view['data']['beschreibung'])) > 0) { ?>
+			<div class="wpsg_product_information_short">
+				<div class="wpsg_produkt_additional_information">
+					<div itemprop="description" class="wpsg_produkt_shortdescription">
+						<span><?php echo $this->view['data']['beschreibung']; ?></span>
+					</div>
+				</div>
+			</div>
+			<?php } ?>
+
+		</div>
+		<?php /* Produktkurzbeschreibung ENDE */ ?>
+
+		<?php /* Varianten START */ ?>
+		<div class="wpsg_produkt_varianten">
+			<?php echo $this->callMod('wpsg_mod_productvariants', 'renderTemplate', array($this->view['data']['product_key'])); ?>
+		</div>
+		<?php /* Varianten ENDE */ ?>
+		
+		<?php $this->callMods('product_bottom', array(&$this->view['data']['product_key'], $this->getTemplateIndex())); ?>
+		
+		<?php /* FlÃ€chenprodukt */ ?>
+		<?php if ($ap['set'] === 1) { ?>
+			<?php $this->render(WPSG_PATH_VIEW.'mods/mod_printshop/product.phtml'); ?>
+		<?php } ?>
+
+		<div class="wpsg_product_buttonarea">			
+			<div class="wpsg_product_buttons_add_basket">
+				<?php if ($this->view['oProduct']->canOrder()) { ?>
+				<div class="wpsg_produkt_add_basket_wrapper">
+
+					<label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label>
+
+					<input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> />
+							
+					<?php /* Urlaubsmodus aktiv */ ?>
+					<?php if ($this->hasMod('wpsg_mod_deliverytime') && ($this->get_option('wpsg_mod_deliverytime_holiday') == '1')) { ?>
+						
+						<?php if ($this->callMod('wpsg_mod_deliverytime', 'holiday', array($this->view['data']['product_key']))) { ?>
+						
+							<div class="wpsg_product_deliverytime_holiday" style="height:50px; padding:10px; width:50%; float:right; border:1px solid #ff0000;">
+																													
+								<?php echo __($this->callMod('wpsg_mod_deliverytime', 'displayHolidaytext', array($this->view['data']['product_key']))); ?>
+								
+							</div>					
+					
+						<?php } ?>
+							
+					<?php } else {?>
+					
+						<input class="wpsg_button wpsg_add_basket wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?>" type="submit" value="<?php echo __('In den Warenkorb', 'wpsg'); ?>" name="wpsg[submit]" />
+					
+					<?php } ?>
+					
+					<?php if (in_array($this->get_option('wpsg_afterinsert'), array('2', '3'))) { ?>
+					<script type="text/javascript">
+
+						jQuery(document).ready(function() {
+
+							jQuery('.wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?>').bind('click', function() {
+
+								wpsg_blockProductTemplate(<?php echo $this->getTemplateIndex(); ?>);
+
+								jQuery.ajax( {
+									url: '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>',
+									data: {
+										'wpsg_form_data': jQuery('#wpsg_produktform_<?php echo $this->getTemplateIndex(); ?>').serialize(),
+										'wpsg[ajax]': '1',
+										'wpsg[submit]': '1'
+									},
+									success: function(data) {
+
+                                        wpsg_refreshBasketWidget();
+										
+										<?php if ($this->get_option('wpsg_afterinsert') == '2') { ?>
+										
+											tb_show('<?php echo __('Ihr Warenkorb', 'wpsg'); ?>', '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET_AJAX); ?>&height=500');
+											
+										<?php } else { ?>
+
+											jQuery('body').append(data);
+
+										<?php } ?>
+
+										wpsg_unblockProductTemplate(<?php echo $this->getTemplateIndex(); ?>);
+
+									}
+								} );
+
+								return false;
+
+							} );
+
+						} );
+
+					</script>
+					<?php } ?>
+
+				</div>
+				<?php } ?>
+			</div>
+		</div>
+
+		<div class="wpsg_clear"></div>
+
+		<?php if ($this->hasMod('wpsg_mod_request') && $this->callMod('wpsg_mod_request', 'isRequestProduct', array($this->view['data']['id']))) { ?>
+			<label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label>
+			<input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> />
+		
+			<input class="wpsg_button wpsg_add_requestlist" id="wpsg_add_requestlist_<?php echo $this->getTemplateIndex(); ?>" type="submit" value="<?php echo __('Auf die Anfrageliste', 'wpsg'); ?>" name="wpsg[submit_request]" />
+		<?php } ?>
+
+		<?php /* Produktlangbeschreibung START */ ?>
+		<div class="wpsg_product_informationarea">
+
+			<?php if (strlen(trim($this->view['data']['longdescription'])) > 0) { ?>
+			<div class="wpsg_product_information_large">
+				<div class="wpsg_produkt_additional_information">
+					<div itemprop="description" class="wpsg_produkt_longdescription">
+						<span><?php echo $this->view['data']['longdescription']; ?></span>
+					</div>
+				</div>
+			</div>
+			<?php } ?>
+
+		</div>
+		<?php /* Produktlangbeschreibung ENDE */ ?>
+		
+		<?php /* zusÃ€tzliche Informationen START */ ?>
+		<div class="wpsg_product_informationarea">
+
+			<?php if (strlen(trim($this->view['data']['moreinfos'])) > 0) { ?>
+			<div class="wpsg_product_information_large">
+				<div class="wpsg_produkt_additional_information">
+					<div itemprop="description" class="wpsg_produkt_moreinfos">
+						<span><?php echo $this->view['data']['moreinfos']; ?></span>
+					</div>
+				</div>
+			</div>
+			<?php } ?>
+
+		</div>
+		<?php /* zusÃ€tzliche Informationen ENDE */ ?>
+		
+		<?php /* zusÃ€tzliche Lieferumfang START */ ?>
+		<div class="wpsg_product_informationarea">
+
+			<?php if (strlen(trim($this->view['data']['moreinfos2'])) > 0) { ?>
+			<div class="wpsg_product_information_large">
+				<div class="wpsg_produkt_additional_information">
+					<div itemprop="description" class="wpsg_produkt_moreinfos2">
+						<span><?php echo $this->view['data']['moreinfos2']; ?></span>
+					</div>
+				</div>
+			</div>
+			<?php } ?>
+
+		</div>
+		<?php /* zusÃ€tzliche Lieferumfang ENDE */ ?>
+
+		<div class="wpsg_clear"></div>
+
+		<?php /* Social Media Integration */ ?>
+		<div class="wpsg_product_social_media">
+			<?php if (is_plugin_active('plugin-directory/shariff.php')) {?>
+				<?php echo do_shortcode('[shariff]')?>
+			<?php } ?>
+		</div>
+		
+	</div>
+
+</div>
Index: /views/mods/mod_printshop/produkt_addedit_content.phtml
===================================================================
--- /views/mods/mod_printshop/produkt_addedit_content.phtml	(revision 7706)
+++ /views/mods/mod_printshop/produkt_addedit_content.phtml	(revision 7706)
@@ -0,0 +1,236 @@
+<?php
+	
+	declare(strict_types=1);
+	
+	/**
+	 * User: Daschmi (daschmi@daschmi.de)
+	 * Date: 14.01.2020
+	 * Time: 07:35
+	 */
+
+	$view = $this->view['wpsg_mod_printshop'];
+	
+	$arMode = [
+		wpsg_mod_printshop::MODE_AREA => __('FlÃ€chenprodukt, freie Eingabe von Breite/LÃ€nge im Frontend', 'wpsg'),
+		wpsg_mod_printshop::MODE_AREA_SELECT => __('FlÃ€chenprodukt, definierte Auswahl von Breite/LÃ€nge im Frontend', 'wpsg'),
+		wpsg_mod_printshop::MODE_LFM => __('FlÃ€chenprodukt, freie Eingabe der Laufmeter im Frontend', 'wpsg'),
+		wpsg_mod_printshop::MODE_LFM_SELECT => __('FlÃ€chenprodukt, definierte Auswahl der Laufmeter im Frontend', 'wpsg')
+	];
+	
+	if (!isset($view['mode'])) $view['mode'] = wpsg_mod_printshop::MODE_AREA;
+	if (!isset($view['unit_price'])) $view['unit_price'] = 'm';
+	
+	if (!isset($view['width_step'])) $view['width_step'] = 10; else $view['width_step'] = $view['width_step'];
+	if (!isset($view['width_min'])) $view['width_min'] = 10; else $view['width_min'] = $view['width_min'];
+	if (!isset($view['width_max'])) $view['width_max'] = 100; else $view['width_max'] = $view['width_max'];
+	
+	if (!isset($view['length_step'])) $view['length_step'] = 10; else $view['length_step'] = $view['length_step'];
+	if (!isset($view['length_min'])) $view['length_min'] = 10; else $view['length_min'] = $view['length_min'];
+	if (!isset($view['length_max'])) $view['length_max'] = 100; else $view['length_max'] = $view['length_max'];
+	
+	if (!isset($view['width'])) $view['width'] = 1000; else $view['width'] = wpsg_tf($view['width']);
+
+?>
+
+<?php echo wpsg_drawForm_AdminboxStart(__('Druckereiprodukt', 'wpsg')); ?>
+
+	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_printshop[set]', __('Produkt als FlÃ€chenprodukt behandeln'), $view['set']); ?>
+
+	<div class="wpsg_mod_printshop wpsg_mod_printshop_1" style="display:none;">
+		
+		<?php echo wpsg_drawForm_Select('wpsg_mod_printshop[mode]', __('Modus'), $arMode, $view['mode']); ?>
+	
+		<br />
+		
+		<?php echo wpsg_drawForm_Input('wpsg_mod_printshop[unit_price]', __('Einheit (Ohne Â²)'), $view['unit_price']); ?>
+		
+		<div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_AREA; ?>">
+						
+		</div>
+		
+		<div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_AREA_SELECT; ?>">
+			 
+			<br />
+			
+			<div class="form-group form-group-sm">				
+				<label class="col-sm-6 control-label"></label>				
+				<div class="col-sm-6">
+					 
+					<div class="row">
+						<div class="col col-sm-4">
+							<?php echo __('Schritte', 'wpsg'); ?>
+						</div>
+						<div class="col col-sm-4">
+							<?php echo __('min.', 'wpsg'); ?>
+						</div>
+						<div class="col col-sm-4">
+							<?php echo __('max.', 'wpsg'); ?>
+						</div>
+					</div>
+					 				
+				</div>
+				<div class="clearfix wpsg_clear"></div>			
+			</div>
+			
+			<div class="form-group form-group-sm">
+				<label class="col-sm-6 control-label"><?php echo __('Breite', 'wpsg'); ?></label>
+				<div class="col-sm-6">
+					
+					<div class="row">
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['width_step']; ?>" name="wpsg_mod_printshop[width_step]" class="wpsg_mod_printshop_input" />
+						</div>
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['width_min']; ?>" name="wpsg_mod_printshop[width_min]" class="wpsg_mod_printshop_input" />
+						</div>
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['width_max']; ?>" name="wpsg_mod_printshop[width_max]" class="wpsg_mod_printshop_input" />
+						</div>
+					</div>
+				
+				</div>
+				<div class="clearfix wpsg_clear"></div>
+			</div>
+			
+			<div class="form-group form-group-sm">
+				<label class="col-sm-6 control-label"><?php echo __('LÃ€nge', 'wpsg'); ?></label>
+				<div class="col-sm-6">
+					
+					<div class="row">
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['length_step']; ?>" name="wpsg_mod_printshop[length_step]" class="wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+						</div>
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['length_min']; ?>" name="wpsg_mod_printshop[length_min]" class="wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+						</div>
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['length_max']; ?>" name="wpsg_mod_printshop[length_max]" class="wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+						</div>
+					</div>
+				
+				</div>
+				<div class="clearfix wpsg_clear"></div>
+			</div>
+		
+		</div>
+		
+		<div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_LFM; ?>">
+			
+			<?php echo wpsg_drawForm_Input('wpsg_mod_printshop[width]', __('Breite fÃŒr Preisberechnung'), wpsg_ff($view['width'], false, true, 0), ['input_class' => 'wpsg_mod_printshop_input_same']); ?>
+			
+		</div>
+		
+		<div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_LFM_SELECT; ?>">
+			
+			<?php echo wpsg_drawForm_Input('wpsg_mod_printshop[width]', __('Breite fÃŒr Preisberechnung'), wpsg_ff($view['width'], false, true, 0), ['input_class' => 'wpsg_mod_printshop_input_same']); ?>
+			
+			<br />
+			
+			<div class="form-group form-group-sm">
+				<label class="col-sm-6 control-label"></label>
+				<div class="col-sm-6">
+					
+					<div class="row">
+						<div class="col col-sm-4">
+							<?php echo __('Schritte', 'wpsg'); ?>
+						</div>
+						<div class="col col-sm-4">
+							<?php echo __('min.', 'wpsg'); ?>
+						</div>
+						<div class="col col-sm-4">
+							<?php echo __('max.', 'wpsg'); ?>
+						</div>
+					</div>
+				
+				</div>
+				<div class="clearfix wpsg_clear"></div>
+			</div>
+			
+			<div class="form-group form-group-sm">
+				<label class="col-sm-6 control-label"><?php echo __('LÃ€nge', 'wpsg'); ?></label>
+				<div class="col-sm-6">
+					
+					<div class="row">
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['length_step']; ?>" name="wpsg_mod_printshop[length_step]" class="wpsg_mod_printshop_same wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+						</div>
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['length_min']; ?>" name="wpsg_mod_printshop[length_min]" class="wpsg_mod_printshop_same wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+						</div>
+						<div class="col col-sm-4">
+							<input type="number" value="<?php echo $view['length_max']; ?>" name="wpsg_mod_printshop[length_max]" class="wpsg_mod_printshop_same wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+						</div>
+					</div>
+				
+				</div>
+				<div class="clearfix wpsg_clear"></div>
+			</div>
+			
+		</div>
+
+        <br />
+
+        <?php echo wpsg_drawForm_Checkbox('wpsg_mod_printshop[productupload_set]', __('Bestellupload ermÃ¶glichen', 'wpsg'), (($view['productupload_set'])?true:false)); ?>
+
+        <div class="wpsg_mod_printshop_productupload_set_1" style="<?php echo (($view['wpsg_mod_printshop[productupload_set]'] === true)?'display:block;':'display:none;'); ?>">
+
+            <?php echo wpsg_drawForm_Input('wpsg_mod_printshop[productupload_length]', __('Maximale Anzahl an Uploads'), $view['productupload_length']); ?>
+            <?php echo wpsg_drawForm_Checkbox('wpsg_mod_printshop[productupload_mandatory]', __('Pflichtfeld'), $view['productupload_mandatory']); ?>
+
+        </div>
+
+    </div>
+
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>
+
+<style>
+	
+	.wpsg_mod_printshop_input { width:100%; }
+	
+</style>
+
+<script>
+
+    jQuery(document).ready(function() {
+
+        jQuery('#wpsg_mod_printshop_productupload_set').on('change', function() {
+
+            if (jQuery(this).prop('checked') === true) {
+
+                jQuery('.wpsg_mod_printshop_productupload_set_1').show();
+                jQuery('#wpsg_mod_printshop_productupload_length').focus();
+
+            } else {
+
+                jQuery('.wpsg_mod_printshop_productupload_set_1').hide();
+
+            }
+
+        } ).change();
+
+        jQuery('.wpsg_mod_printshop_input_same').on('input', function() {
+
+            var jqThis = jQuery(this);
+
+            jQuery('.wpsg_mod_printshop_input_same[name="' + jqThis.attr("name") + '"]').val(jqThis.val());
+            console.log((jqThis.val()));
+
+        });
+
+        jQuery('#wpsg_mod_printshopmode').on('change', function() {
+
+            jQuery('.wpsg_mod_printshop_mode').hide();
+            jQuery('.wpsg_mod_printshop_mode_' + jQuery(this).val()).show().find('input').first().focus();
+
+        }).change();
+
+        jQuery('#wpsg_mod_printshopset').on('change', function() {
+
+            jQuery('.wpsg_mod_printshop').hide();
+            jQuery('.wpsg_mod_printshop_' + ((jQuery(this).prop('checked'))?'1':'0')).show();
+
+        }).change();
+
+    } );
+	
+</script>
Index: /views/mods/mod_printshop/settings_edit.phtml
===================================================================
--- /views/mods/mod_printshop/settings_edit.phtml	(revision 7706)
+++ /views/mods/mod_printshop/settings_edit.phtml	(revision 7706)
@@ -0,0 +1,11 @@
+<?php
+	
+	/**
+	 * User: Daschmi (daschmi@daschmi.de)
+	 * Date: 14.01.2020
+	 * Time: 07:30
+	 */
+	
+	declare(strict_types=1);
+ 
+
Index: /views/warenkorb/checkout.phtml
===================================================================
--- /views/warenkorb/checkout.phtml	(revision 7705)
+++ /views/warenkorb/checkout.phtml	(revision 7706)
@@ -7,4 +7,5 @@
  
 	//wpsg_debug($this->view);
+
 ?>	
 <script type="text/javascript">/* <![CDATA[ */
Index: /views/warenkorb/checkout2.phtml
===================================================================
--- /views/warenkorb/checkout2.phtml	(revision 7705)
+++ /views/warenkorb/checkout2.phtml	(revision 7706)
@@ -70,5 +70,5 @@
 					<?php } ?>
 					 
- 					<?php if ((isset($p['hint']) && trim($p['hint']) != '') || $p['price'] > 0) { ?>					
+ 					<?php if ((isset($p['hint']) && trim($p['hint']) != '') || wpsg_getFloat($p['price']) > 0) { ?>
 					<div id="payment_<?php echo $p['id']; ?>_hint" class="shippay_hint">
 						<?php if ($p['price'] > 0) { ?>
Index: /views/warenkorb/index.phtml
===================================================================
--- /views/warenkorb/index.phtml	(revision 7705)
+++ /views/warenkorb/index.phtml	(revision 7706)
@@ -122,2 +122,4 @@
 
 </aside>
+
+<?php wpsg_debug($_SESSION['wpsg']); ?>
Index: /wpshopgermany.php
===================================================================
--- /wpshopgermany.php	(revision 7705)
+++ /wpshopgermany.php	(revision 7706)
@@ -194,5 +194,5 @@
     }
 
-    if (!is_admin() && !session_id()) { session_start(); }
+    if (!session_id()) { session_start(); }
 
 	// UPLOADS Dir fÃŒr MultiblogunterstÃŒtzung
@@ -212,6 +212,4 @@
 	// Standardrollen fÃŒr die Rechteverteilung 
 	$role_object = get_role('administrator');
-
-    $role_object = get_role('administrator');
     
     if (is_object($role_object)) {
