Index: /changelog
===================================================================
--- /changelog	(revision 7016)
+++ /changelog	(revision 7019)
@@ -109,2 +109,7 @@
 - Feature: optionale Integration der Kontaktdaten des Datenschutzbeauftragten
 - Feature: Integration eines EU-Vertreters fÃŒr Shops mit Hauptsitz auÃerhalb der EU
+
+#4.0.9
+- Feature: Produktvarianten - Export von Produktname / Produktartikelnummer ÃŒber Exportprofile mÃ¶glich
+- Feature: Lagerbestand - Export vom Lagerbestand / Mindestlagerbestand ÃŒber Exportprofile mÃ¶glich
+- Feature: Aboprodukte - Export von Abo Startzeit, Abo Laufzeit, Abo Kosten VerlÃ€ngerung und Abo Dauer (Tage) ÃŒber Exportprofile mÃ¶glich
Index: /mods/wpsg_mod_abo.class.php
===================================================================
--- /mods/wpsg_mod_abo.class.php	(revision 7016)
+++ /mods/wpsg_mod_abo.class.php	(revision 7019)
@@ -922,4 +922,109 @@
             }
             
+        }
+
+        public function wpsg_mod_export_loadFields(&$arFields) {
+
+            $arFields[10]['fields']['wpsg_mod_abo_starttime'] = __('Abo Startzeit', 'wpsg');
+            $arFields[10]['fields']['wpsg_mod_abo_runningtime'] = __('Abo Laufzeit', 'wpsg');
+            $arFields[10]['fields']['wpsg_mod_abo_price'] = __('Abo Kosten VerlÃ€ngerung', 'wpsg');
+            $arFields[10]['fields']['wpsg_mod_abo_duration'] = __('Abo Dauer (Tage)', 'wpsg');
+            
+        }
+
+        public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $product_key, $product_index, $profil_separator) {
+
+            if (!in_array($field_value, ['wpsg_mod_abo_runningtime', 'wpsg_mod_abo_starttime', 'wpsg_mod_abo_price', 'wpsg_mod_abo_duration'])) return;
+            
+            $return = '';
+            
+            $abo_order = $this->isAboOrder($o_id);
+            $abo_order_id = 0;
+            
+            if ($abo_order === false) return;
+            else if ($abo_order === 1) $abo_order_id = $o_id;
+            else if ($abo_order === 2) $abo_order_id = $this->getOriginOrder($o_id);
+            
+            $arAboProducts = $this->getAboProductsFromOrder($abo_order_id);
+            $arProductExportKeys = [];
+            
+            if (wpsg_isSizedInt($p_id)) {
+
+                /** @var \wpsg_order_product $oOrderProduct */
+                foreach ($arAboProducts as $oOrderProduct) {
+                    
+                    if ($oOrderProduct->getProductKey() == $product_key) {
+                        
+                        $arProductExportKeys[] = $product_key;
+                        
+                    }
+                    
+                }
+                
+            } else {
+
+                /** @var \wpsg_order_product $oOrderProduct */
+                foreach ($arAboProducts as $oOrderProduct) {
+
+                    $arProductExportKeys[] = $oOrderProduct->getProductKey();
+                    
+                }
+                
+            }
+            
+            if (wpsg_isSizedArray($arProductExportKeys)) {
+            
+                if ($field_value === 'wpsg_mod_abo_runningtime') {
+            
+                    foreach ($arProductExportKeys as $product_key) {
+                        
+                        $abo_info = $this->getAboProductStatus($abo_order_id, $product_key);
+                        
+                        $arReturn[] = wpsg_fromDate($abo_info['expiration']);
+                        
+                    }
+                    
+                    $return = implode(',', $arReturn); 
+                    
+                } else if ($field_value === 'wpsg_mod_abo_starttime') {
+
+                    foreach ($arProductExportKeys as $product_key) {
+
+                        $abo_info = $this->getAboProductStatus($abo_order_id, $product_key);
+
+                        $arReturn[] = wpsg_fromDate($abo_info['cdate']);
+
+                    }
+
+                    $return = implode(',', $arReturn);
+
+                } else if ($field_value === 'wpsg_mod_abo_price') {
+
+                    foreach ($arProductExportKeys as $product_key) {
+                     
+                        $oProduct = wpsg_product::getInstance($this->shop->getProduktID($product_key));
+                        
+                        $arReturn[] = wpsg_ff($oProduct->wpsg_mod_abo_price);
+                                                
+                    }
+                    
+                    $return = implode(',', $arReturn);
+                    
+                } else if ($field_value === 'wpsg_mod_abo_duration') {
+
+                    foreach ($arProductExportKeys as $product_key) {
+
+                        $oProduct = wpsg_product::getInstance($this->shop->getProduktID($product_key));
+
+                        $arReturn[] = $oProduct->wpsg_mod_abo_durration;
+
+                    }
+
+                    $return = implode(',', $arReturn);
+                    
+                }
+                
+            }
+                        
         }
         
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 7016)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 7019)
@@ -2148,4 +2148,56 @@
 		}	// public function produkt_save(&$produkt_id)
 
+        public function wpsg_mod_export_loadFields(&$arFields) { 
+            
+            $arFields[10]['fields']['wpsg_mod_productvariants_varname'] = __('Varianten Name', 'wpsg');
+            $arFields[10]['fields']['wpsg_mod_productvariants_varanr'] = __('Varianten Artikelnummer', 'wpsg');
+            
+        }
+
+        public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $product_key, $product_index, $profil_separator) {
+
+            if (!in_array($field_value, ['wpsg_mod_productvariants_varname', 'wpsg_mod_productvariants_varanr'])) return;
+            
+            $return = '';
+
+            $arProductExportProductKeys = [];
+            $arReturn = [];
+
+            if (wpsg_isSizedString($product_key)) $arProductExportProductKeys = [$product_key];
+            else {
+
+                $oOrder = wpsg_order::getInstance($o_id);
+
+                /** @var \wpsg_order_product $oOrderProducts */
+                foreach ($oOrder->getOrderProducts() as $oOrderProduct) {
+
+                    if (!in_array($oOrderProduct->getProductKey(), $arProductExportProductKeys)) $arProductExportProductKeys[] = $oOrderProduct->getProductKey();
+
+                }
+
+            }
+            
+            foreach ($arProductExportProductKeys as $product_key) {
+                
+                if ($this->isVariantsProductKey($product_key)) {
+    
+                    $arVariInfo = $this->getVariantenInfoArray($product_key);
+                    
+                    if ($field_value === 'wpsg_mod_productvariants_varname') {
+                                            
+                        $return = $arVariInfo['key']; 
+                        
+                    } else if ($field_value === 'wpsg_mod_productvariants_varanr') {
+    
+                        $return = $arVariInfo['akey'];
+    
+                    }
+                    
+                }
+                
+            }
+            
+        }
+        
 	} // class wpsg_mod_productvariants extends wpsg_mod_basic
 
Index: /mods/wpsg_mod_stock.class.php
===================================================================
--- /mods/wpsg_mod_stock.class.php	(revision 7016)
+++ /mods/wpsg_mod_stock.class.php	(revision 7019)
@@ -133,5 +133,7 @@
 			$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, array(
 				"stock" => wpsg_q($_REQUEST['wpsg_mod_stock_stock']),
-				"stock_count" => wpsg_q($_REQUEST['wpsg_mod_stock_stock_count'])
+				"stock_count" => wpsg_q($_REQUEST['wpsg_mod_stock_stock_count']),
+                "minstockproduct_count" => wpsg_q($_REQUEST['wpsg_mod_minstockproduct']),
+                "minstockproduct_mail" => wpsg_q($_REQUEST['wpsg_mod_stock_minstockproduct_mail'])
 			), "`id` = '".wpsg_q($produkt_id)."'");
 
@@ -608,6 +610,4 @@
 		} // public function basket_save_product(&$data, &$product_data)
 
-		/* Modulfunktionen */
-
 		public function checkReduceStock(&$data, &$product_data)
 		{
@@ -705,39 +705,65 @@
 		} // public function checkReduceStock(&$data, &$product_data)
 
-		/**
-		 * Export der Daten als CSV
-		 * {@inheritDoc}
-		 * @see wpsg_mod_basic::wpsg_mod_export_loadFields()
-		 */
-		public function wpsg_mod_export_loadFields(&$arFields)
-		{
-			
-			$arFields[20]['fields']['mod_stock_stock'] = __('Lagerbestand', 'wpsg');
+        /**
+         * Export der Daten als CSV
+         * {@inheritDoc}
+         * @see wpsg_mod_basic::wpsg_mod_export_loadFields()
+         */
+        public function wpsg_mod_export_loadFields(&$arFields) {
+
+            $arFields[20]['fields']['mod_stock_stock'] = __('Lagerbestand', 'wpsg');
+            $arFields[20]['fields']['mod_stock_minstock'] = __('Mindestlagerbestand', 'wpsg');
+
+        }
+        
+		public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $productkey, $product_index, $profil_separator) {
+
+		    // Abbrechen wenn uninteressante Felder
+            if (!in_array($field_value, ['mod_stock_stock', 'mod_stock_minstock'])) return;
+		    
+            $arProductExportIDs = [];
+            $arReturn = [];
+		    
+		    if (wpsg_isSizedInt($p_id)) $arProductExportIDs = [$p_id];
+            else {
+
+                $oOrder = wpsg_order::getInstance($o_id);
+                
+                /** @var \wpsg_order_product $oOrderProducts */
+                foreach ($oOrder->getOrderProducts() as $oOrderProduct) {
+                    
+                    if (!in_array($oOrderProduct->getProductId(), $arProductExportIDs)) $arProductExportIDs[] = $oOrderProduct->getProductId();
+                    
+                }
+                
+            }
+            		                            
+		    if ($field_value === 'mod_stock_stock') {
+		    		        
+		        foreach ($arProductExportIDs as $product_id) {
+
+                    $oProduct = wpsg_product::getInstance($product_id);
+                    
+                    $arReturn[] = $oProduct->stock;
+		            
+                }
+                
+                $return = implode(',', $arReturn);
+		        
+            } else if ($field_value === 'mod_stock_minstock') {
+
+                foreach ($arProductExportIDs as $product_id) {
+
+                    $oProduct = wpsg_product::getInstance($product_id);
+
+                    $arReturn[] = $oProduct->minstockproduct_count;
+                    
+                }
+
+                $return = implode(',', $arReturn);
+                
+            }
 			
 		}
-		
-		/*
-		public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $productkey, $product_index, $profil_separator)
-		{
-			$arOrder = $this->shop->cache->loadOrder($o_id);
-			$value = "";
-			
-			if ($field_value == 'mod_creditcard_typ')
-			{
-				$value = $arOrder['mod_creditcard_typ'];
-			}
-			
-			else 
-				
-			{
-				
-				$key = $this->shop->get_option("wpsg_mod_stock");
-				$return = $value;
-				
-			}
-			
-			
-		}
-		*/
 		
 		/**
