Index: /changelog
===================================================================
--- /changelog	(revision 8490)
+++ /changelog	(revision 8491)
@@ -656,2 +656,3 @@
 - Bugfix: Exportprofile - Problem mit Feld "Anzahl Produkte" korrigiert
 - Bugfix: Datumsformatierung mit IntlDateFormatter
+- Bugfix: Produktname, Artikelnummer, EAN bei Varianten in Export berÃŒcksichtigen
Index: /mods/wpsg_mod_export.class.php
===================================================================
--- /mods/wpsg_mod_export.class.php	(revision 8490)
+++ /mods/wpsg_mod_export.class.php	(revision 8491)
@@ -991,6 +991,6 @@
 
                         foreach ($profil['fields'] as $f) {
-
-                            $row[] = $this->getValue($f, $profil['field_delimiter'], $order_id, $p['p_id'], null, $p['order_product_id']);
+ 
+                            $row[] = $this->getValue($f, $profil['field_delimiter'], $order_id, $p['p_id'], null, intval($p['order_product_id']));
 
                         }
@@ -1011,25 +1011,9 @@
 
 				$oOrder->setMeta('wpsg_mod_export_order_onetime_'.$profil_id, time());
-				
-				/*
-                wpsg_product::clearCache();
-                wpsg_order::clearCache($order_id);
-                wpsg_customer::clearCache();
-                wpsg_order_product::clearCache();
-
-                $this->shop->cache->clearOrderCache(false);
-                $this->shop->cache->clearProductCache(false);
-                $this->shop->cache->clearKundenCache(false);
-				
-                gc_collect_cycles ();
-				*/
-	            
+	           
             } // foreach arData
 
-	        $time_elapsed_secs = microtime(true) - $start;				
-			//die("= ".$time_elapsed_secs.'s');
-	         
-	        //die('<pre>'.print_r($arExportData, true).'</pre>');
-	        
+			die(wpsg_debug($arExportData));
+			
             foreach ($arExportData as $row) {
 
@@ -1929,4 +1913,6 @@
 			$oProduct = null;
 			$oOrderProduct = null;
+			$combination_id = null;
+			$product_key = null;
 			
             $field_value = $f['value_key'];
@@ -2035,5 +2021,5 @@
 					/** @var wpsg_order_product $oOrderProduct */
 					$oOrderProduct = $this->arCache['order_product_id'][$order_product_id];
-					 					
+					
 				} else {
 					
@@ -2044,4 +2030,15 @@
 					
 				}
+				
+				/*
+				if ($this->shop->callMod('wpsg_mod_productvariants', 'isVariantsProductKey', [$oOrderProduct->getProductKey()])) {
+					
+					$oCombination = \wpsg\wpsg_combination::getByProductAndKey($oOrderProduct->getProductId(), $oOrderProduct->getProductKey());
+					$combination_id = $oCombination->getId();
+					
+				}
+				*/
+				
+				$product_key = $oOrderProduct->getProductKey();
 				
 			}
@@ -2287,6 +2284,6 @@
                 case 'produkt_id': $return = $oProduct->getId(); break;
                 case 'produkt_index': $return = $oOrderProduct->getProductIndex(); break;
-				case 'produkt_name': if (!isset($oProduct)) throw new \Exception(); $return = $oProduct->getProductName(false, $pvari_ID); break;
-                case 'produkt_detailname': if (!isset($oProduct)) throw new \Exception(); $return = $oProduct->getProductName(true, $pvari_ID); break;
+				case 'produkt_name': if (!isset($oProduct)) throw new \Exception(); $return = $oProduct->getProductName(false, $product_key); break;
+                case 'produkt_detailname': if (!isset($oProduct)) throw new \Exception(); $return = $oProduct->getProductName(true, $product_key); break;
                 case 'product_url': $return = $oProduct->getProductURL(); break;
                 case 'product_picture_url':
@@ -2438,5 +2435,5 @@
 
                     break;
-                case 'produkt_anr': $return = $oProduct->getNr($pvari_ID); break;
+                case 'produkt_anr': $return = $oProduct->getNr($product_key); break;
 				case 'produkt_menge': $return = $oOrderProduct->__get('menge'); break;
                 case 'produkt_ean': $return = $oProduct->getEAN(); break;
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 8490)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 8491)
@@ -2544,103 +2544,5 @@
 
 		} // public function getVariantenInfoArray($vari_key)
-
-        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');
-            $arFields[10]['fields']['wpsg_mod_productvariants_product_varname'] = __('Produktname / Varianten Name', 'wpsg');
-	
-			$arVariant = $this->db->fetchAssoc("
-                SELECT
-                    V.`id`, V.`name`, V.`product_id`
-                FROM
-                    ".WPSG_TBL_VARIANTS." AS V
-                    	LEFT JOIN `".WPSG_TBL_PRODUCTS."` AS P ON (P.`id` = V.`product_id`)
-                WHERE
-                    V.`deleted` != '1' AND
-                    (V.`product_id` <= 0 OR P.`deleted` = '0')
-            ");
-            
-            foreach ($arVariant as $v) {
-                
-                if (wpsg_isSizedInt($v['product_id'])) $label = __('Produktvariante', 'wpsg');
-                else $label = __('Globale Variante', 'wpsg');
-
-                if (trim($v['name']) === '') $label = wpsg_translate(__('Unbenannte #1# (ID:#2#)', 'wpsg'), $label, $v['id']); 
-                else $label = wpsg_translate(__('#1# #2# (ID:#3#)', 'wpsg'), $label, $v['name'], $v['id']);
-
-                $arFields[10]['fields']['var_'.$v['id']] = $label;
-                
-            }
-             
-        }
-
-        public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $order_product_id, $profil_separator) {
-
-			if (wpsg_isSizedInt($order_product_id)) {
-			
-				$oOrderProduct = wpsg_order_product::getInstance($order_product_id);
-				  
-				$product_key = $oOrderProduct->getProductKey();
-				 
-			    if (preg_match('/^var_\d+$/', $field_value)) {
-			        
-			        $var_id = intval(substr($field_value, 4));
-			        $arProductKey = $this->explodeProductKey($product_key);
-			        $arVariation = $this->getVariationOfVariant($var_id);
-			        
-			        $return = $arVariation[$arProductKey['arVari'][$var_id]]['name'];
-			                        
-	            } else if (in_array($field_value, ['wpsg_mod_productvariants_varname', 'wpsg_mod_productvariants_varanr', 'wpsg_mod_productvariants_product_varname'])) {
-	           
-	                $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_product_varname') {
-								
-								$return = $oOrderProduct->getProduct()->getProductName().' / '.$arVariInfo['key'];
-								
-	                        } else if ($field_value === 'wpsg_mod_productvariants_varanr') {
-	        
-	                            $return = $arVariInfo['akey'];
-	        
-	                        }
-	                        
-	                    }
-	                    
-	                }
-	                
-	            }
-
-			}
-            
-        }
-
+ 
         public function product_deletePermanently($product_id) {
 
