Index: /changelog
===================================================================
--- /changelog	(revision 7052)
+++ /changelog	(revision 7055)
@@ -135,2 +135,3 @@
 #4.0.12
 - Bugfix: Abfrage, ob Column bei Import schon vorhanden ist
+- Bugfix: Produktvarianten - Lagerbestand der aktuell ausgewÃ€hlten Variante wird jetzt im Produkttemplate angezeigt 
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7052)
+++ /controller/wpsg_ShopController.class.php	(revision 7055)
@@ -1813,4 +1813,5 @@
 			if (isset($produkt['op_mwst_key']))
 			{
+			    
 				$produkt['mwst_key'] = $produkt['op_mwst_key'];
 				$produkt['preis'] = $produkt['price'];
@@ -1818,4 +1819,5 @@
 				$produkt['preis_brutto'] = $produkt['price_brutto'];
 				//$produkt['mwst_value'] = $produkt['op_mwst_value'];
+                
 			}
 
@@ -1901,9 +1903,12 @@
 			// Artikelnummer
 			$produkt['anr'] = $this->getProductAnr($produkt['id']);
+			
 			// $_REQUEST  $_SESSION $GLOBALS
 			if ($this->get_option('wpsg_afterinsert') == '3')
 			{
-				if (isset($_REQUEST['wpsg']['produkt_id']) && ($_REQUEST['wpsg']['produkt_id'] == $produkt['product_id']))
-					if (isset($_REQUEST['wpsg']['product_key'])) $produkt['id']	= $_REQUEST['wpsg']['product_key'];
+				
+			    if (isset($_REQUEST['wpsg']['produkt_id']) && ($_REQUEST['wpsg']['produkt_id'] == $produkt['product_id']))
+				if (isset($_REQUEST['wpsg']['product_key'])) $produkt['id']	= $_REQUEST['wpsg']['product_key'];
+			    
 			}
 			
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 7052)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 7055)
@@ -329,7 +329,15 @@
  
 				}
-
+				               
 				$arProductKey = $this->explodeProductKey($product_data['product_key']);
 
+                $product_data['stock'] = 0;
+                
+                foreach ($arProductKey['arVari'] as $var_id => $vari_id) {
+
+                    $product_data['stock'] += $product_data['arVariant'][$var_id]['arVariation'][$vari_id]['stock'];
+                    
+                }
+                
 				$arProductImagesPossible = array();
 				$arPostidsImagesPossible = array();
@@ -414,5 +422,5 @@
 
 				}
-
+				
 				// Preise fÃŒr das Frontend ermitteln
 				if ($this->shop->getFrontendTaxView() === WPSG_BRUTTO)
Index: /views/produkttemplates/standard.phtml
===================================================================
--- /views/produkttemplates/standard.phtml	(revision 7052)
+++ /views/produkttemplates/standard.phtml	(revision 7055)
@@ -145,5 +145,6 @@
 			<?php if (($this->view['data']['stock']) > '0') {?>		
 				
-				<label><?php echo wpsg_translate(__('#1#','wpsg'), $this->view['data']['stock']);  ?></label><?php echo wpsg_translate(__(' Artikel auf Lager', 'wpsg')); ?>
+                <label><?php echo __('Lagerbestand', 'wpsg'); ?></label>
+                <?php echo wpsg_translate(__('#1# Artikel auf Lager','wpsg'), $this->view['data']['stock']);  ?>
 			
 			<?php } else { ?>
