Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 7350)
+++ /lib/wpsg_basket.class.php	(revision 7351)
@@ -656,5 +656,5 @@
 		 * Ist der Parameter $finish_order auf false so bleiben die Bestelldaten in der Session (Zur Vorspeicherung)
 		 */
-		public function save($finish_order = true, $sendmail = true) {
+		public function save($finish_order = true, $sendmail = true, $save = false) {
 			
 			$knr = '';
@@ -824,6 +824,16 @@
 				//$o_id = $oCalculation->toDB(@$_SESSION['wpsg']['order_id'], [], $finish_order);
 				
+				$o_id = @$_SESSION['wpsg']['order_id'];
+				
+				if ($save) {
+					
+					$o_id = $oCalculation->toDB(@$_SESSION['wpsg']['order_id'], [], $finish_order);
+					
+					$_SESSION['wpsg']['order_id'] = $o_id;
+					
+				}
+				
 				if ($finish_order) {
-					
+					 
 					$update_data['onr'] = wpsg_q($this->shop->buildONR(@$_SESSION['wpsg']['order_id'], $k_id, $knr));
 					
@@ -831,7 +841,7 @@
 						'comment' => $this->arCheckout['comment']
 					], $finish_order);
-					
-				}
-				
+										
+				}
+				 
 				if ($finish_order === true) $update_data['status'] = wpsg_ShopController::STATUS_EINGEGANGEN;
 				else $update_data['status'] = wpsg_ShopController::STATUS_UNVOLLSTAENDIG;
@@ -843,7 +853,5 @@
 					
 					foreach ($oCalculation->getCalculationArray()['product'] as $p) {
-						
-						
-						
+						 
 						$produkt_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($p['product_id'])."'");
 						
@@ -882,5 +890,5 @@
 					
 					$this->db->UpdateQuery(WPSG_TBL_KU, $kdata, "`id` = '".wpsg_q($k_id)."'");
-					
+					 
 					// Alte BestellID muss nach Abschluss entfernt werden
 					unset($_SESSION['wpsg']['order_id']);
@@ -892,5 +900,5 @@
 					
 				} else {
-					
+					 
 					$_SESSION['wpsg']['order_id'] = $o_id;
 					
Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 7350)
+++ /model/wpsg_order.class.php	(revision 7351)
@@ -921,23 +921,4 @@
 			 
 		} // public function getShippingCountryID()
-
-		public function createDB() {
-			
-			$order_id = $this->id;
-			
-			if (!wpsg_isSizedInt($this->id)) {
-				
-				$order_id = $this->db->ImportQuery(WPSG_TBL_ORDER, [
-					'cdate' => 'NOW()',
-					'status' => wpsg_q(wpsg_ShopController::STATUS_UNVOLLSTAENDIG)
-				]);
-				
-				$_SESSION['wpsg']['order_id'] = $order_id;
-				
-			}
-			
-			return $order_id;
-			
-		}
 		
 		/**
Index: /mods/wpsg_mod_billsafe.class.php
===================================================================
--- /mods/wpsg_mod_billsafe.class.php	(revision 7350)
+++ /mods/wpsg_mod_billsafe.class.php	(revision 7351)
@@ -452,5 +452,5 @@
 			var_dump($response);
 			$strMailtext = ob_get_contents();
-			ob_end_clean();
+			ob_end_clean(); 
 			
 			// Eintrag ins Protokoll
Index: /mods/wpsg_mod_paypalapi.class.php
===================================================================
--- /mods/wpsg_mod_paypalapi.class.php	(revision 7350)
+++ /mods/wpsg_mod_paypalapi.class.php	(revision 7351)
@@ -1095,6 +1095,7 @@
 			$access_token = $this->api_getAccessToken();
 			
-			$order_id = $oOrder->createDB();
-			
+			// Dadurch wird die Bestellung in der DB fixiert und Platzhalter kÃ€nnen generiert werden
+			if (!M1::isSizedInt($order_id)) $order_id = $this->shop->basket->save(false, false, true);
+						
 			$item_list = array(
 				'items' => array()
Index: /views/mods/mod_productvariants/mail_row.phtml
===================================================================
--- /views/mods/mod_productvariants/mail_row.phtml	(revision 7350)
+++ /views/mods/mod_productvariants/mail_row.phtml	(revision 7351)
@@ -5,3 +5,3 @@
  */
 
-?><?php echo wpsg_pad_left(__('Variante:', 'wpsg').' ', 15); ?><?php echo $this->view['variante']['key']; ?>
+?><?php echo wpsg_pad_left(__('Variante:', 'wpsg').' ', 15); ?><?php echo $this->view['variante']['key']; ?> 
Index: /wpshopgermany.php
===================================================================
--- /wpshopgermany.php	(revision 7350)
+++ /wpshopgermany.php	(revision 7351)
@@ -11,5 +11,12 @@
 	Author URI: http://maennchen1.de/
 	*/
- 
+
+	if (@isset($_REQUEST['t'])) {
+		
+		session_start();
+		echo "==".$_SESSION['wpsg']['order_id'];
+		die();
+	}
+	
 	define('WPSG_VERSION', '9.9.9');
 
@@ -246,3 +253,5 @@
     add_action('wpsg_daily_hook', [$GLOBALS['wpsg_sc'], 'wpsg_daily_hook']);
     
-	$GLOBALS['wpsg_sc']->callMods('load', array()); 
+	$GLOBALS['wpsg_sc']->callMods('load', array());
+	
+	remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
