Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 6453)
+++ /controller/wpsg_ShopController.class.php	(revision 6454)
@@ -3135,4 +3135,5 @@
 			if (isset($_REQUEST['noheader']) && $_REQUEST['noheader'] == '1') return;
 
+			/*
 			if (is_array($this->arLizenz) && isset($this->arLizenz['l']))
 			{
@@ -3156,5 +3157,5 @@
 
 			}
-
+			*/
 			if (
 				$this->get_option("wpsg_version_installed", true) != false &&
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 6453)
+++ /lib/functions.inc.php	(revision 6454)
@@ -1127,5 +1127,7 @@
 		$isset = true;		
 		if (!isset($strValue)) return false;
-		//if (gettype($strValue) != 'string') return false;
+		if (is_int($strValue)) $strValue = strval($strValue);
+		
+		if (gettype($strValue) != 'string') return false;
 		
 		if (strlen($strValue) <= 0) $isset = false;
Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 6453)
+++ /lib/wpsg_basket.class.php	(revision 6454)
@@ -627,4 +627,5 @@
 		{
 
+			$knr = '';
 			try
 			{
Index: /lib/wpsg_imagehandler.class.php
===================================================================
--- /lib/wpsg_imagehandler.class.php	(revision 6453)
+++ /lib/wpsg_imagehandler.class.php	(revision 6454)
@@ -122,5 +122,5 @@
 				$arVariInfo = $this->shop->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($product_key));
 				
-				return $arVariInfo['images'];
+				return array_values($arVariInfo['images']);
                                 
 			}
@@ -141,5 +141,5 @@
 			}
 			
-			return $arAttachmentIDs; 
+			return array_values($arAttachmentIDs); 
 			
 		} // public function getAttachmentIDs($product_id)
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 6453)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 6454)
@@ -262,4 +262,7 @@
 						{
 
+							$vari_data['pics']= explode(',', $vari_data['images_set']);
+							$vari_data['postids']= explode(',', $vari_data['images']);
+							/*
 							$pics = unserialize($vari_data['images']);
 							unset($vari_data['pics']);
@@ -275,7 +278,7 @@
 								}
 								$vari_data['pics'] = $pic;
-								$vari_data['postids'] = $postids;								
+								$vari_data['postids'] = $postids;
 							}
-
+							*/
 							if (isset($vari_data['pics'])) {
 								if (wpsg_isSizedArray($arProductImagesPossible)) $arProductImagesPossible = array_intersect($arProductImagesPossible, $vari_data['pics']);
@@ -1408,6 +1411,10 @@
 			{
 
+				$arAttachmentIDs = $this->shop->imagehandler->getAttachmentIDs($_REQUEST['product_id']);
+				$arAttachmentIDsAll = $this->shop->imagehandler->getAttachmentIDs($_REQUEST['product_id']);
+				
 				$this->db->ImportQuery(WPSG_TBL_PRODUCTS_VARIATION, array(
 					'variation_id' => wpsg_q($variation_id),
+					'images' => implode(',', $arAttachmentIDsAll),
 					'product_id' => wpsg_q($_REQUEST['product_id'])
 				));
@@ -2173,5 +2180,5 @@
 					'value' => $vp_data[$var_id]['arVariation'][$var_value]['name'],
 					'preis'	=> $vp_data[$var_id]['arVariation'][$var_value]['price'],
-					'artnr'	=> @$vp_data[$var_id]['arVariation'][$var_value]['artnr'],
+					'artnr'	=> @$vp_data[$var_id]['arVariation'][$var_value]['anr'],
 					'images' => $arImagesVariation
 				);
@@ -2219,4 +2226,6 @@
 			$varis = $GLOBALS['wpsg_sc']->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_PRODUCTS_VARIATION."` WHERE `product_id`='".wpsg_q($produkt_id)."' ");
 			
+			return;
+			//TODO
 			foreach ($varis as $v)
 			{
Index: /views/mods/mod_productvariants/admin_edit.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_edit.phtml	(revision 6453)
+++ /views/mods/mod_productvariants/admin_edit.phtml	(revision 6454)
@@ -164,5 +164,5 @@
 				<td class="col_action">
     			    			
-    				<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation lÃ¶schen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+    				<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation lÃ¶schen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $this->view['product_id'].','.$vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
     				
     			</td>    
Index: /views/mods/mod_productvariants/admin_html.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_html.phtml	(revision 6453)
+++ /views/mods/mod_productvariants/admin_html.phtml	(revision 6454)
@@ -74,5 +74,5 @@
 	} // function wpsg_mod_productvariants_del(variant_id)
 
-	function wpsg_mod_productvariation_del(variation_id)
+	function wpsg_mod_productvariation_del(product_id, variation_id)
 	{
 
@@ -88,4 +88,5 @@
 			data: {  
 				'subaction': 'admin_variation_del',
+				'product_id': product_id,
 				'variation_id': variation_id,
 				'variant_id': vari_id
Index: /views/mods/mod_productvariants/produkt.phtml
===================================================================
--- /views/mods/mod_productvariants/produkt.phtml	(revision 6453)
+++ /views/mods/mod_productvariants/produkt.phtml	(revision 6454)
@@ -14,5 +14,5 @@
 				<div class="wpsg_vp_field wpsg_vp_field_<?php echo $this->getProduktId($this->view['data']['id']); ?>">
 					 
-					<?php if ($var['typ'] != 'radio') { ?>
+					<?php if ($var['type'] != wpsg_mod_productvariants::TYPE_RADIO) { ?>
 						<label class="wpsg_vp_field_label" for="wpsg_vpfield_<?php echo $this->getProduktId($this->view['data']['id']); ?>_<?php echo $k; ?>">
 							<?php echo $var['name']; ?>
@@ -22,5 +22,5 @@
 					<?php } ?>
 					
-					<div class="wpsg_vp_field_typ_<?php echo $var['typ']; ?>">
+					<div class="wpsg_vp_field_typ_<?php echo $var['type']; ?>">
 					
 						<?php /* SELECT-Box START */ ?>
@@ -63,5 +63,5 @@
 								<?php } ?>	
 								</select> 
-								<?php if ($this->get_option("wpsg_vp_showpic") == "1" && $this->hasMod('wpsg_mod_produktbilder')) { ?>
+								<?php if ($this->get_option("wpsg_vp_showpic") == "1") { ?>
 									<span class="wpsg_vp_field_image">				
 										<?php foreach ($var['arVariation'] as $kv => $vari) { 
@@ -70,13 +70,12 @@
 													
 													<?php 
-													/*
-													$img_src = $this->callMod('wpsg_mod_produktbilder', 'makeTn', array(
-														$this->getProduktId($this->view['data']['id']), 
-														$vari['showpic'],
-														$this->get_option("wpsg_vp_showpic_width"),
-														$this->get_option("wpsg_vp_showpic_height"), 
-														's'
-													));
-													*/
+													if (isset($this->view['data']['product_key'])) {
+														$arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['data']['product_key']);
+														$attachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']);
+														
+														echo wp_get_attachment_image($attachmentID, 'medium');
+														
+													}
+													
 													$pbw = $this->get_option("wpsg_vp_showpic_width");
 													$pbh = $this->get_option("wpsg_vp_showpic_height");
@@ -93,5 +92,5 @@
 						
 						<?php /* IMAGE START */ ?>
-						<?php if ($var['type'] == wpsg_mod_productvariants::TYPE_IMAGE && $this->hasMod('wpsg_mod_produktbilder')) { ?>
+						<?php if ($var['type'] == wpsg_mod_productvariants::TYPE_IMAGE) { ?>
 							<div class="wpsg_mod_productvariants_imageselect wpsg_mod_productvariants_imageselect_<?php echo $k; ?>">
 							<span>
@@ -99,13 +98,16 @@
 								<?php $kkv = -1; foreach ($var['arVariation'] as $kv => $vari) { $kkv++;
 									if ($vari['active'] == '1' && (!$this->hasMod('wpsg_mod_stock') || $vari['stock'] > 0)) { ?>
-										<?php $img = $vari['guid']; ?>								
-										<?php if (wpsg_isSizedString($img)) { 
-											$pbw = $this->get_option('wpsg_vp_imageselect_width');
-											$pbh = $this->get_option('wpsg_vp_imageselect_height');
-										?>
-											<a data-wpsg-id="<?php echo $kv; ?>" class="wpsg_vp_update_image image <?php echo ((wpsg_getStr($this->view['wpsg_mod_productvariants']['set'][$k]) == $kv)?'akt':''); ?>" onclick="jQuery(this).parent().find('a').removeClass('akt'); jQuery(this).addClass('akt'); return false;" href="#">
-												<img src="<?php echo $img; ?>" width="<?php echo $pbw; ?>" height="<?php echo $pbh; ?>"/>
+
+										<?php
+										if (isset($this->view['data']['product_key'])) {
+											$arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['data']['product_key']);
+											$attachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']);
+											?>
+											<a data-wpsg-id="<?php echo $kv; ?>" class="wpsg_vp_update_image image <?php echo ((wpsg_getStr($this->view['wpsg_mod_productvariants']['set'][$k]) == $kv)?'akt':''); ?>" href="#">
+												<?php echo wp_get_attachment_image($attachmentID, 'thumbnail'); ?>
 											</a>
+											
 										<?php } ?>
+										
 									<?php } ?>
 								<?php } ?>
@@ -146,14 +148,4 @@
 											
 												<?php 
-												/*
-												$img_src = $this->callMod('wpsg_mod_produktbilder', 'makeTn', array(
-													$this->getProduktId($this->view['data']['id']), 
-													$vari['showpic'],
-													$this->get_option("wpsg_vp_showpic_width"),
-													$this->get_option("wpsg_vp_showpic_height"), 
-													's'
-												));
-												*/
-												
 												$pbw = $this->get_option("wpsg_vp_showpic_width");
 												$pbh = $this->get_option("wpsg_vp_showpic_height");
@@ -186,5 +178,5 @@
 				jQuery(this).closest('span').find('input').val(jQuery(this).data('wpsg-id'));
 				wpsg_mod_productvariants_reload(event);
-				
+				alert('TEST');
 			} ); 
 			
Index: /views/produkttemplates/standard.phtml
===================================================================
--- /views/produkttemplates/standard.phtml	(revision 6453)
+++ /views/produkttemplates/standard.phtml	(revision 6454)
@@ -11,9 +11,7 @@
 	//$this->noReleatedProducts = true;
 
-	$arImages = $this->callMod('wpsg_mod_productvariants', 'getKombiVariImages', array($this->view['data']['product_key']));
-	if (!wpsg_isSizedArray($arImages))
-		$arImages = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->view['data']['product_key']));
-		//$arImages = array();
-
+	$arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['data']['product_key']);
+	$arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']);
+		
 ?>
 
@@ -38,18 +36,14 @@
 
 		<?php /* Block fÃŒr die Produktbilder START */ ?>
-		<?php if (wpsg_isSizedArray($arImages)) { ?>
+		<?php if (wpsg_isSizedArray($arAttachmentIDsAll)) { ?>
 		<div class="wpsg_productimages">
 
 			<div class="wpsg_produkt_produktbilder">
 
-				<?php $att = wp_get_attachment_image_src($arImages[0]['post_id'], array(300, 300), false); ?>
-				<a 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($arImages[0]['post_id'], array(300, 300), false, array()); ?>
-				</a>
-
-				<?php if (sizeof($arImages) > 1) { for ($i = 1; $i < sizeof($arImages); $i ++) { ?>
-					<?php $att = wp_get_attachment_image_src($arImages[$i]['post_id'], array(300, 300), false); ?>
-					<a 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($arImages[$i]['post_id'], array(300, 300), false, array()); ?>
+				<?php if (sizeof($arAttachmentIDsAll) > 1) { for ($i = 0; $i < sizeof($arAttachmentIDsAll); $i ++) { ?>
+					<?php $att = wp_get_attachment_image($arAttachmentIDsAll[$i], array(300, 300), false); ?>
+					<?php $att = wp_get_attachment_image_src($arAttachmentIDsAll[$i], array(300, 300), false); ?>
+					<a  <?php if ($arAttachmentIDsAll[$i] != $arAttachmentIDs[0]) 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 } } ?>
Index: /views/warenkorb/basket.phtml
===================================================================
--- /views/warenkorb/basket.phtml	(revision 6453)
+++ /views/warenkorb/basket.phtml	(revision 6454)
@@ -42,34 +42,23 @@
 			<div class="basket_product_row">
 
-				<?php $this->view['$bPicture'] = false; ?>
-
-				<?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1' && $this->hasMod('wpsg_mod_produktbilder')) {
-
-					if (wpsg_isSizedString($product_data['varianten_image'])) $arImages = array($product_data['varianten_image']);
-					else $arImages = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->getProduktID($product_data['id'])));
+				<?php $this->view['$bPicture'] = false;
+
+				?>
+				<?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1') {
 
 				?>
 				<div class="productimage">
-					<?php if (wpsg_isSizedString($arImages[0]['guid'])) { ?>
 
 					<?php
 					if (isset($product_data['product_key'])) {
-						$arr = $this->callMod('wpsg_mod_productvariants', 'getKombiVariImages', array($product_data['product_key']));
-						if (wpsg_isSizedArray($arr))
-						{
-							$ais = wp_get_attachment_image_src($arr[0]['post_id'], 'thumbnail');
-							$url = $ais[0];
-						}
-						else
-						{
-							$url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
-						}
-					} else {
-						$url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
+						$arAttachmentIDs = $this->imagehandler->getAttachmentIDs($product_data['product_key']);
+						$attachmentID = $this->imagehandler->getAttachmentID($product_data['product_key']);
+						
+                        echo wp_get_attachment_image($attachmentID, 'medium');
+						
 					}
-					if (wpsg_isSizedString($url)) $this->view['$bPicture'] = true;
-					echo "<img src=".$url." alt='' />";
+					if ($attachmentID > 0) $this->view['$bPicture'] = true;
+					//echo "<img src=".$url." alt='' />";
 					?>
-					<?php } ?>
 				</div>
 				<?php } ?>
Index: /views/warenkorb/overview.phtml
===================================================================
--- /views/warenkorb/overview.phtml	(revision 6453)
+++ /views/warenkorb/overview.phtml	(revision 6454)
@@ -123,33 +123,22 @@
 				<?php $this->view['$bPicture'] = false; ?>
 
-				<?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1' && $this->hasMod('wpsg_mod_produktbilder')) {
-
-					if (wpsg_isSizedString($product_data['varianten_image'])) $arImages = array($product_data['varianten_image']);
-					else $arImages = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->getProduktID($product_data['id'])));
+				<?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1') {
 
 				?>
 				<div class="productimage">
-					<?php if (wpsg_isSizedString($arImages[0]['guid'])) { ?>
 
 					<?php
+
 					if (isset($product_data['product_key'])) {
-						$arr = $this->callMod('wpsg_mod_productvariants', 'getKombiVariImages', array($product_data['product_key']));
-						if (wpsg_isSizedArray($arr))
-						{
-							$ais = wp_get_attachment_image_src($arr[0]['post_id'], 'thumbnail');
-							$url = $ais[0];
-						}
-						else
-						{
-							$url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
-						}
-					} else {
-						$url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
+						$arAttachmentIDs = $this->imagehandler->getAttachmentIDs($product_data['product_key']);
+						$attachmentID = $this->imagehandler->getAttachmentID($product_data['product_key']);
+						
+						echo wp_get_attachment_image($attachmentID, 'medium');
+						
 					}
-					if (wpsg_isSizedString($url)) $this->view['$bPicture'] = true;
-					echo "<img src=".$url." alt='' />";
+					if ($attachmentID > 0) $this->view['$bPicture'] = true;
+					
 					?>
 
-					<?php } ?>
 				</div>
 				<?php } ?>
