Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 5581)
+++ /controller/wpsg_ShopController.class.php	(revision 5583)
@@ -1079,8 +1079,8 @@
 			if (wpsg_isSizedArray($produkt_id)) 
 			{
-				
+
 				$this->view['data'] = $produkt_id;
 				$produkt_id = $this->view['data']['id'];
-				
+
 			}
 			else $this->view['data'] = $this->loadProduktArray($produkt_id);
@@ -1120,5 +1120,6 @@
 			$this->view['data']['product_key'] = $this->view['data']['id']; 
 			$this->view['data']['id'] = $this->getProduktId($this->view['data']['id']);
-			$this->view['oProduct'] = wpsg_product::getInstance($this->view['data']['id']);
+
+			$this->view['oProduct'] = wpsg_product::getInstance($this->view['data']['id'], $this->view['data']);
 
 			$html  = '';
@@ -1501,13 +1502,5 @@
 				
 			}
-			
-			// Wenn es ein Variantenprodukt ist, dann setz ich einen standard VariantenschlÃŒssel			
-			if ($this->hasMod('wpsg_mod_varianten'))
-			{
-				
-				$produkt['id'] = $this->callMod('wpsg_mod_varianten', 'getDefaultVariKey', array($produkt['id']));
-				
-			}
-			 
+
 			// Artikelnummer
 			$produkt['anr'] = $this->getProductAnr($produkt['id']);
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 5581)
+++ /model/wpsg_product.class.php	(revision 5583)
@@ -12,10 +12,12 @@
 		const MULTIPLE_MULTI_ONE = 2; // Mehrfach mit Menge 1
 
+		private $loadedData = array(); /* EnthÃ€lt die Daten, die ÃŒber den ShopController und die Module geladen / erweitert wurden */
+
 		/**
 		 * LÃ€dt die Daten des Produkts
 		 */
-		public function load($product_id)
-		{
-		
+		public function load($product_id, $loadedData = false)
+		{
+
 			parent::load($product_id);
 							
@@ -47,5 +49,8 @@
 			
 			if ($this->data['id'] != $product_id) $this->shop->throwErrorCode('100_5', array('Gesuchte ID:'.$product_id, 'Gefundene ID:'.$this->data['id']));
-			
+
+			if (wpsg_isSizedArray($loadedData)) $this->loadedData = $loadedData;
+			else $this->loadedData = $this->shop->loadProduktArray($this->data['id']);
+
 			return true;
 				
@@ -242,5 +247,24 @@
 		{
 
-			return $this->calculateTaxViewPrice($this->preis, $taxView);
+			if ($taxView === false)
+			{
+
+				if (is_admin()) $taxView = $this->shop->getBackendTaxview();
+				else $taxView = $this->shop->getFrontendTaxview();
+
+			}
+ 
+			if ($taxView === WPSG_BRUTTO)
+			{
+
+				return $this->loadedData['preis_brutto'];
+
+			}
+			else
+			{
+
+				return $this->loadedData['preis_netto'];
+
+			}
 
 		}
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 5581)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 5583)
@@ -129,5 +129,18 @@
 			
 		} // public function be_ajax()
-		
+
+		public function wpsg_enqueue_scripts()
+		{
+
+			if (!is_admin())
+			{
+
+				wp_enqueue_script('wpsg_mod_productvariants_js', $this->shop->getRessourceURL('mods/mod_productvariants/frontend.js'));
+				wp_localize_script('wpsg_mod_productvariants_js', 'wpsg_vp_showpic', array('wpsg_vp_showpic' => $this->shop->get_option('wpsg_vp_showpic')));
+
+			}
+
+		} // public function wpsg_enqueue_scripts()
+
 		public function product_addedit_content(&$product_content, &$product_data)
 		{
@@ -149,7 +162,101 @@
 				
 		} // public function product_addedit_content(&$product_content, &$produkt_data)
-		
-		/* Modulfunktionen */ 
-		
+
+		public function loadProduktArray(&$product_data)
+		{
+
+			$product_data['arVariant'] = $this->getVariants($product_data['product_id'], true, true, true);
+
+			if (wpsg_isSizedArray($product_data['arVariant']))
+			{
+
+				// Default Kombination setzen
+				if (!isset($product_data['product_key']) || is_numeric($product_data['product_key']))
+				{
+
+					$arDefaultKey = array();
+
+					foreach ($product_data['arVariant'] as $variant_id => $variant_data)
+					{
+
+						$arDefaultKey[] = $variant_id.':'.array_keys($variant_data['arVariation'])[0];
+
+					}
+
+					$strDefaultKey = 'pv|'.implode('|', $arDefaultKey);
+
+					$product_data['product_key'] = $strDefaultKey;
+
+				}
+
+				// Preise fÃŒr die Varianten berechnen
+				if ($this->shop->getBackendTaxView() === WPSG_BRUTTO)
+				{
+
+					$product_data['preis_brutto_preVariants'] = $product_data['preis_brutto'];
+					$product_data['preis_brutto'] = $this->calculateVariantsPrice($product_data['preis_brutto'], $product_data['arVariant'], $product_data['product_key']);
+					$product_data['preis_netto'] = wpsg_calculatePreis($product_data['preis_brutto'], WPSG_BRUTTO, 'mwst_value');
+
+				}
+				else
+				{
+
+					$product_data['preis_netto_preVariants'] = $product_data['preis_netto'];
+					$product_data['preis_netto'] = $this->calculateVariantsPrice($product_data['preis_netto'], $product_data['arVariant'], $product_data['product_key']);
+					$product_data['preis_brutto'] = wpsg_calculatePreis($product_data['preis_netto'], WPSG_NETTO, 'mwst_value');
+
+				}
+
+				$product_data['preis_preVariants'] = $product_data['preis'];
+
+				// Preise fÃŒr das Frontend ermitteln
+				if ($this->shop->getFrontendTaxView() === WPSG_BRUTTO)
+				{
+
+					$product_data['preis'] = $product_data['preis_brutto'];
+
+				}
+				else
+				{
+
+					$product_data['preis'] = $product_data['preis_netto'];
+
+				}
+
+			}
+
+		} // public function loadProduktArray(&$produkt_data)
+
+		/* Modulfunktionen */
+
+		/**
+		 * Integration in das Produkttemplate
+		 */
+		public function productTemplate($product_data)
+		{
+
+
+
+		} // public function productTemplate($product_key)
+
+		private function calculateVariantsPrice($price, $arVariant, $product_key)
+		{
+
+			$product_key = substr($product_key, 3);
+
+			$arKeyVariant = explode('|', $product_key);
+
+			foreach ($arKeyVariant as $variant_key)
+			{
+
+				list($variant_id, $variation_id) = explode(':', $variant_key);
+
+				$price += $arVariant[$variant_id]['arVariation'][$variation_id]['price'];
+
+			}
+
+			return $price;
+		}
+
 		private function admin_showAction()
 		{
@@ -472,5 +579,5 @@
 		 * @param Boolean $global Globale Varianten? 
 		 */
-		public function getVariants($product_id = false, $global = true)
+		public function getVariants($product_id = false, $global = true, $onlyActive = false, $loadVariationen = false)
 		{
 			
@@ -552,7 +659,33 @@
 			foreach ($arData as $k => $v)
 			{
-				
-				$arData[$k]['type_label'] = self::$arTypeLabel[$arData[$k]['type']];
-								
+
+				if ($onlyActive === true && !wpsg_isSizedInt($v['count_active'])) unset($arData[$k]);
+				else
+				{
+
+					$arData[$k]['type_label'] = self::$arTypeLabel[$arData[$k]['type']];
+
+					if ($loadVariationen === true && wpsg_isSizedInt($product_id))
+					{
+
+						$arData[$k]['arVariation'] = $this->db->fetchAssoc("
+							SELECT
+								PVI.*,
+								VI.`name`
+							FROM
+								`".WPSG_TBL_VARIANTS_VARI."` AS VI
+									LEFT JOIN `".WPSG_TBL_PRODUCTS_VARIATION."` AS PVI ON (PVI.`variation_id` = VI.`id`)
+							WHERE
+								VI.`deleted` != '1' AND
+								VI.`variant_id` = '".wpsg_q($v['id'])."' AND
+								PVI.`product_id` = '".wpsg_q($product_id)."' AND 
+								PVI.`active` = '1' 							
+							ORDER BY
+								VI.`pos` ASC 
+						", "id");
+
+					}
+				}
+
 			}
 			
Index: /views/mods/mod_productvariants/admin_edit.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_edit.phtml	(revision 5581)
+++ /views/mods/mod_productvariants/admin_edit.phtml	(revision 5583)
@@ -28,7 +28,9 @@
         		<th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
         		<th class="col_stock"><?php echo __('Lagerbestand', 'wpsg'); ?></th>
-        		<?php } else { $colspan ++; ?>
-        		<th class="col_action"></th>
         		<?php } ?>
+
+		        <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { $colspan ++; ?>
+			    <th class="col_action"></th>
+		        <?php } ?>
         		
       		</tr>
@@ -48,5 +50,5 @@
     				<script type="text/javascript">/* <![CDATA[ */
 
-    					<?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+    					<?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
 						jQuery('#productvariation_name_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
 							submitdata: { 
@@ -61,6 +63,6 @@
 					    		field_id: '<?php echo $vari['id']; ?>'
 							}
-						});		
-						<?php } else { ?>
+						});
+					    <?php } ?>
 
 						jQuery('#productvariation_active_<?php echo $vari['id']; ?>').bind('change', function() {
@@ -104,5 +106,5 @@
 							}
 						});
-						<?php } ?>		
+
 		
 					/* ]]> */</script>	
@@ -115,11 +117,13 @@
     			<td class="col_price"><span class="wpsg_editable" id="productvariation_price_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['price'], $this->get_option('wpsg_currency'))); ?></span></td>
     			<td class="col_stock"><span class="wpsg_editable" id="productvariation_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['stock']); ?></span></td>
-    			<?php } else { ?>    			 
-    			<td class="col_action">
+    			<?php } ?>
+
+			    <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
+				<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>
     				
     			</td>    
-    			<?php } ?>			
+    			<?php } ?>
     			
     		</tr>
@@ -177,4 +181,16 @@
 
 <?php } else { ?>
-<?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
+
+	<?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
+
+	<script type="text/javascript">/* <![CDATA[ */
+
+		<?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?>
+			jQuery('.wpsg_mod_productvariants_variation_add_button').show();
+		<?php } else { ?>
+			jQuery('.wpsg_mod_productvariants_variation_add_button').hide();
+		<?php } ?>
+
+	/* ]]> */</script>
+
 <?php } ?>
Index: /views/mods/mod_productvariants/admin_html.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_html.phtml	(revision 5581)
+++ /views/mods/mod_productvariants/admin_html.phtml	(revision 5583)
@@ -10,13 +10,16 @@
 <div id="wpsg_mod_productvariants_dialog" class="wpsg_mod_productvariants_dialog_noDialog">
             
-      <div class="modal-body">
-
-      </div>
-      <div class="modal-footer">
-      
-      	<button type="button" class="btn-sm wpsg_mod_productvariants_variants btn btn-default" onclick="return wpsg_mod_productvariants_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Produktvariante', 'wpsg'); ?></button> 
-        <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Variation', 'wpsg'); ?></button>
-
-      </div>
+    <div class="modal-body">
+
+    </div>
+    <div class="modal-footer">
+
+		<button type="button" class="btn-sm wpsg_mod_productvariants_variants btn btn-default" onclick="return wpsg_mod_productvariants_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php
+
+			echo ((wpsg_isSizedInt($_REQUEST['edit_id'])?__('Neue Produktvariante', 'wpsg'):__('Neue Variante', 'wpsg')));
+
+		?></button>
+
+    </div>
       
 </div>
@@ -34,6 +37,6 @@
 			<div class="modal-footer">
 
-				<button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Variation', 'wpsg'); ?></button>
-				<button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" style="display:none;" onclick="return wpsg_mod_productvariants_back();"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;<?php echo __('SchlieÃen', 'wpsg'); ?></button>
+				<button type="button" class="btn-sm wpsg_mod_productvariants_variation_add_button btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Variation', 'wpsg'); ?></button>
+				<button type="button" class="btn-sm wpsg_mod_productvariants_variants_close wpsg_mod_productvariants_variants_vari btn btn-default" style="display:none;" onclick="return wpsg_mod_productvariants_back();"><span class="glyphicon glyphicon-remove"></span>&nbsp;<?php echo __('SchlieÃen', 'wpsg'); ?></button>
 
 			</div>
@@ -41,5 +44,5 @@
 	</div>
 </div>
- 
+
 <script type="text/javascript">/* <![CDATA[ */
 
@@ -80,6 +83,6 @@
 		var vari_id = jQuery('#wpsg_mod_productvariants_var_id').val();
 		
-		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
-		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		jQuery('#wpsg_mod_productvariants_dialog_modal button').prop('disabled', true);
+		jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
 		
 		jQuery.ajax( {
@@ -92,6 +95,6 @@
 			success: function(data) { 
 				
-				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
-				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); 
+				jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html(data);
+				jQuery('#wpsg_mod_productvariants_dialog_modal button').prop('disabled', false);
 
 			}
@@ -109,4 +112,6 @@
 		jQuery('#wpsg_mod_productvariants_dialog_modal button').prop('disabled', true);
 		jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		jQuery('.wpsg_mod_productvariants_variants_close').show();
+
 		jQuery('#wpsg_mod_productvariants_dialog_modal').modal( { } ).modal('show');
 
