Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 5846)
+++ /controller/wpsg_ShopController.class.php	(revision 5854)
@@ -2782,9 +2782,15 @@
 				//wpsg_admin_pflicht
 				$arPflicht = $this->get_option('wpsg_admin_pflicht');				
-				foreach ((array)$arPflicht['custom'] as $index => $kv)
-				{
+
+				if (wpsg_isSizedArray($arPflicht['custom']))
+				{
+				
+					foreach (arPflicht['custom'] as $index => $kv)
+					{
 					 
-					$arReplace['/%kv_'.$index.'%/i'] = $this->getCustomFieldFromDB($kunden_id, $index);
+						$arReplace['/%kv_'.$index.'%/i'] = $this->getCustomFieldFromDB($kunden_id, $index);
 										
+					}
+					
 				}
 								
@@ -3697,5 +3703,5 @@
 		{
 			
-			//echo '<pre>';debug_print_backtrace();echo '</pre>'; wpsg_debug("OK");
+			$arShippingNew = array();
 			
 			// Damit es auch ohne View aus wpsg_basket.class beim prÃŒfen der Versandarten aufgerufen werden kann
Index: /lib/install.php
===================================================================
--- /lib/install.php	(revision 5846)
+++ /lib/install.php	(revision 5854)
@@ -90,4 +90,5 @@
    		paypal_payer_id VARCHAR(255) NOT NULL,   		
    		geb DATE NOT NULL,
+   		email VARCHAR(500) NOT NULL COMMENT 'E-Mail Adresse des Kunden',
    		ustidnr VARCHAR(100) NOT NULL,   		
    		custom TEXT NOT NULL,
Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 5846)
+++ /lib/wpsg_basket.class.php	(revision 5854)
@@ -8,8 +8,8 @@
 	{
 		
-		/** Das Datenbankobjekt */
+		/** @var wpsg_db */
 		var $db;
 		
-		/** Das Shop Objekt */
+		/** @var wpsg_ShopController */
 		var $shop;
 		
@@ -294,5 +294,5 @@
 			
 			$this->loadFromSession = true;
-			
+
 		} // public function initFromSession()
 		
@@ -573,16 +573,6 @@
 				
 				// Eintrag in Kundentabelle
-				$data = array(
-					'title' 	=> wpsg_q(wpsg_getStr($this->arCheckout['title'])),
-					'name' 		=> wpsg_q(wpsg_getStr($this->arCheckout['name'])),
-					'vname' 	=> wpsg_q(wpsg_getStr($this->arCheckout['vname'])),
-					'email' 	=> wpsg_q(wpsg_getStr($this->arCheckout['email'])),
-					'firma' 	=> wpsg_q(wpsg_getStr($this->arCheckout['firma'])),
-					'fax' 		=> wpsg_q(wpsg_getStr($this->arCheckout['fax'])),
-					'strasse' 	=> wpsg_q(wpsg_getStr($this->arCheckout['strasse'])),
-					'plz' 		=> wpsg_q(wpsg_getStr($this->arCheckout['plz'])),
-					'ort' 		=> wpsg_q(wpsg_getStr($this->arCheckout['ort'])),
-					'land' 		=> wpsg_q(wpsg_getStr($this->arCheckout['land'])),
-					'tel' 		=> wpsg_q(wpsg_getStr($this->arCheckout['tel'])),
+				$data = array(					
+					'email' 	=> wpsg_q(wpsg_getStr($this->arCheckout['email'])),					
 					'geb' 		=> wpsg_q(wpsg_toDate(wpsg_getStr($this->arCheckout['geb']))),
 					'ustidnr' 	=> wpsg_q(wpsg_getStr($this->arCheckout['ustidnr']))
@@ -628,4 +618,5 @@
 				
 				$data['custom'] = array();
+				
 				if (isset($this->arCheckout['custom']) && wpsg_isSizedArray($this->arCheckout)) $data['custom'] = $this->arCheckout['custom'];
 						
@@ -648,4 +639,6 @@
 				$data['custom'] = serialize($data['custom']);
 				
+				$update_customer_data = array();
+				
 				if ($k_id > 0)
 				{
@@ -671,18 +664,48 @@
 					$knr = $this->shop->buildKNR($k_id);
 					
-					$this->db->UpdateQuery(WPSG_TBL_KU, array(
-						'knr' => wpsg_q($knr)
-					), "`id` = '".wpsg_q($k_id)."'");
+					$update_customer_data['knr'] = wpsg_q($knr);
+									 
+					$this->shop->callMods('customer_created', array(&$k_id, &$this->arCheckout['password']));				
+					
+				}
+				
+				// Adresse speichern wenn der Kunde noch keine Adresse hat				
+				$customer_data = $this->shop->cache->loadKunden($k_id, true);
+				
+				$adress_data = array(
+					'firma' => wpsg_q(wpsg_getStr($this->arCheckout['firma'])),
+					'title' => wpsg_q(wpsg_getStr($this->arCheckout['title'])),
+					'vname' => wpsg_q(wpsg_getStr($this->arCheckout['vname'])),
+					'name' => wpsg_q(wpsg_getStr($this->arCheckout['name'])),
+					'strasse' => wpsg_q(wpsg_getStr($this->arCheckout['street'])),
+					'nr' => wpsg_q(wpsg_getStr($this->arCheckout['nr'])),
+					'plz' => wpsg_q(wpsg_getStr($this->arCheckout['plz'])),
+					'ort' => wpsg_q(wpsg_getStr($this->arCheckout['ort'])),
+					'tel' => wpsg_q(wpsg_getStr($this->arCheckout['tel'])),
+					'fax' => wpsg_q(wpsg_getStr($this->arCheckout['fax'])),
+					'land' => wpsg_q(wpsg_getStr($this->arCheckout['land']))
+				);
+				
+				if (!wpsg_isSizedInt($customer_data['adress_id']))
+				{
 				 
-					$this->shop->callMods('customer_created', array(&$k_id, &$this->arCheckout['password']));				
-					
-				}
+					$adress_data['cdate'] = 'NOW()';
+					
+					$customer_data['adress_id'] = wpsg_q($this->db->ImportQuery(WPSG_TBL_ADRESS, $adress_data));
+										
+				}
+				else
+				{
+			 
+					$this->db->UpdateQuery(WPSG_TBL_ADRESS, $adress_data, " `id` = '".wpsg_q($customer_data['adress_id'])."' ");
+					
+				}
+				
+				// Kundendaten ggf. aktualisieren
+				if (wpsg_isSizedArray($update_customer_data)) $this->db->UpdateQuery(WPSG_TBL_KU, $update_customer_data, "`id` = '".wpsg_q($k_id)."'");
 				
 				$arBasket['checkout']['k_id'] = $k_id;
 				$arBasket['checkout']['knr'] = $knr;
 							
-				// Der Kunde ist ab 14.08.2015 nicht mehr angemeldet
-				//$_SESSION['wpsg']['checkout']['id'] = wpsg_xss($k_id);
-				 
 				// Produkte letztmalig ÃŒberprÃŒfen			
 				foreach ($arBasket['produkte'] as $p_id => &$p)
@@ -1281,37 +1304,8 @@
 							
 						}
-						
-						foreach ($arBasket['produkte'] as $k => $v)
-						{
-							
-							/*
-							if ($arBasket['noMwSt'] == '1')
-							{
-								
-								$arBasket['produkte'][$k]['preis'] = $arBasket['produkte'][$k]['preis_netto'];
-								
-							}
-							else
-							{
-															
-								if ($this->shop->get_option('wpsg_preisangaben') == WPSG_NETTO)
-								{
-								
-									$arBasket['produkte'][$k]['preis'] = $arBasket['produkte'][$k]['preis_netto'];
-									
-								}
-								else
-								{
-									
-									$arBasket['produkte'][$k]['preis'] = $arBasket['produkte'][$k]['preis_brutto'];
-									
-								}
-								
-							}
-							*/
-							
-						}
-						
-					}
+						 						
+					}
+					
+					$arBasket['oOrder'] = wpsg_order::getInstance($this->o_id);
 					
 					return $arBasket;
@@ -1323,4 +1317,6 @@
 			$arReturn = array();
 
+			$arReturn['oOrder'] = wpsg_order::getInstance($_SESSION['wpsg']['order_id']);
+			
 			if (wpsg_isSizedInt($this->arCheckout['land']))
 			{
Index: /lib/wpsg_cache.class.php
===================================================================
--- /lib/wpsg_cache.class.php	(revision 5846)
+++ /lib/wpsg_cache.class.php	(revision 5854)
@@ -197,8 +197,8 @@
 		 * LÃ€dt die reinen Kundendaten aus der Datenbank und gibt sie zurÃŒck
 		 */
-		public function loadKunden($kunde_id) 
-		{
-
-			if (!array_key_exists($kunde_id, $this->_arKunden))
+		public function loadKunden($kunde_id, $noCache = false) 
+		{
+
+			if (!array_key_exists($kunde_id, $this->_arKunden) || $noCache === true)
 			{
 					
Index: /views/produkttemplates/standard.phtml
===================================================================
--- /views/produkttemplates/standard.phtml	(revision 5846)
+++ /views/produkttemplates/standard.phtml	(revision 5854)
@@ -164,8 +164,8 @@
 					</div>
 					
-					<?php /* Hinweistext für Verzögerung in der Lieferzeit */ ?>
+					<?php /* Hinweistext fÃŒr VerzÃ¶gerung in der Lieferzeit */ ?>
 					<?php if ($this->get_option('wpsg_mod_deliverytime_delay') == '1') { ?>
 						<div class="wpsg_mod_deliverytime_delay">
-							<?php echo wpsg_translate(__('Aufgrund von #1# kann es zu Verzögerungen von #2# Tage in der Zustellung kommen.', 'wpsg'), $this->get_option('wpsg_mod_deliverytime_delayText'), $this->get_option('wpsg_mod_deliverytime_delayTime')); ?>
+							<?php echo wpsg_translate(__('Aufgrund von #1# kann es zu Verzï¿œgerungen von #2# Tage in der Zustellung kommen.', 'wpsg'), $this->get_option('wpsg_mod_deliverytime_delayText'), $this->get_option('wpsg_mod_deliverytime_delayTime')); ?>
 						</div>
 					<?php } ?>
@@ -245,5 +245,5 @@
 			
 			<?php /* Produkt nur im Store, nicht im Onlineshop vorhanden */ ?>
-				<?php if ($this->view['data']['storeproduct'] >= '1') {?>
+				<?php if (wpsg_isSizedInt($this->view['data']['storeproduct'])) {?>
 					
 					<span class="wpsg_product_only_store"><?php  echo wpsg_translate($this->get_option('wpsg_mod_deliverytime_storetext')); ?></span><br />
Index: /views/warenkorb/basket.phtml
===================================================================
--- /views/warenkorb/basket.phtml	(revision 5846)
+++ /views/warenkorb/basket.phtml	(revision 5854)
@@ -150,5 +150,5 @@
 						<?php } ?>
 					</select>
-					<?php } else { ?>
+					<?php } else if (array_key_exists($this->view['basket']['checkout']['shipping'], $this->arShipping)) { ?>
 					<span><?php echo $this->arShipping[$this->view['basket']['checkout']['shipping']]['name']; ?></span>
 					<?php } ?>
