Index: /mods/wpsg_mod_export.class.php
===================================================================
--- /mods/wpsg_mod_export.class.php	(revision 8147)
+++ /mods/wpsg_mod_export.class.php	(revision 8148)
@@ -607,5 +607,5 @@
         } // public function be_ajax()
 
-	    public function basket_save_done(&$order_id, &$customer_id, &$oBasket) {
+	    public function basket_save_done(&$order_id, $customer_id, $oBasket) {
 			
 			$arProfile = $this->db->fetchAssoc("
@@ -1088,5 +1088,5 @@
             $root = $doc->createElement($this->clearXML($profil['xml_roottag']));
             $root = $doc->appendChild($root);
-
+			
             foreach ($arData as $oProduct)
             {
@@ -1158,4 +1158,6 @@
             $arData = wpsg_order::find($arOrderFilter);
 
+			//$arData = [wpsg_order::getInstance(3662)];
+	        
             $profil = $this->loadProfil($profil_id);
 
@@ -1192,5 +1194,5 @@
 				
 			}
-//$arData = [wpsg_order::getInstance(3678)];
+			
             foreach ($arData as $oOrder) {
 
@@ -1209,5 +1211,74 @@
                 }
 
-                foreach ($profil['fields'] as $f) {
+                // Produkte
+                $arOrderProducts = $oOrder->getOrderProducts();
+
+                foreach ($arOrderProducts as $oOrderProduct) {
+					
+                    $tag_product = false;
+
+                    foreach ($profil['fields'] as $f) {
+
+						$arRootline = explode('/', $f['name']);
+						
+                        // Wert ist ein Produktfeld
+                        if ($this->getFieldGroup($f['value_key']) == 20 || (sizeof($arRootline) > 0 && $arRootline[0] === $profil['xml_productroottag'] && $arRootline[1] === $profil['xml_producttag'])) {
+
+                            if ($tag_product === false) $tag_product = $doc->createElement($this->clearXML($profil['xml_producttag']));
+
+                            $value = $this->getValue($f, $profil['field_delimiter'], $oOrder->id, $oOrderProduct->getProductId(), null, $oOrderProduct->getId());
+
+                            if (wpsg_isSizedInt($f['xml_att'])) {
+
+                                $att = $doc->createAttribute($this->clearXML($f['name']));
+                                $att->value = htmlspecialchars($value);
+
+                                $tag_product->appendChild($att);
+
+
+                            } else {
+
+								if (strpos($f['name'], '/') !== false) {
+									 
+									if ($arRootline[0] === $profil['xml_productroottag'] && $arRootline[1] === $profil['xml_producttag']) {
+									
+										$this->addXMLNode($doc, $tag_product, implode('/', array_slice($arRootline, 2)), $value, $f);
+										
+									}  
+									
+								} else {
+								
+	                                $tag = $doc->createElement($this->clearXML($f['name']));
+	                                $tag = $tag_product->appendChild($tag);
+	
+									if (intval($f['format']) === 950) {
+						
+										$tag_value = $doc->createCDATASection($value);
+										
+									} else {
+										
+										$tag_value = $doc->createTextNode(htmlspecialchars($value));
+										
+									} 
+									
+	                                $tag->appendChild($tag_value);
+
+								}
+
+                            }
+
+                        }
+                    }
+
+                    if ($tag_product !== false) {
+
+                        $tag_product_root->appendChild($tag_product);
+
+                    }
+
+                } // foreach Produkte
+
+	            // Andere Felder
+	            foreach ($profil['fields'] as $f) {
 
 					$arRootline = explode('/', $f['name']);
@@ -1237,5 +1308,5 @@
 									$this->addXMLNode($doc, $tag_order, implode('/', array_slice($arRootline, 1)), $value, $f);
 									
-								}
+								}  
 								 
 							} else {
@@ -1263,73 +1334,7 @@
 
                 }
-
-                // Produkte
-                $arOrderProducts = $oOrder->getOrderProducts();
-
-                foreach ($arOrderProducts as $oOrderProduct) {
-					
-                    $tag_product = false;
-
-                    foreach ($profil['fields'] as $f) {
-
-						$arRootline = explode('/', $f['name']);
-						
-                        // Wert ist ein Produktfeld
-                        if ($this->getFieldGroup($f['value_key']) == 20 || (sizeof($arRootline) > 0 && $arRootline[0] === $profil['xml_productroottag'] && $arRootline[1] === $profil['xml_producttag'])) {
-
-                            if ($tag_product === false) $tag_product = $doc->createElement($this->clearXML($profil['xml_producttag']));
-
-                            $value = $this->getValue($f, $profil['field_delimiter'], $oOrder->id, $oOrderProduct->getProductId(), null, $oOrderProduct->getId());
-
-                            if (wpsg_isSizedInt($f['xml_att'])) {
-
-                                $att = $doc->createAttribute($this->clearXML($f['name']));
-                                $att->value = htmlspecialchars($value);
-
-                                $tag_product->appendChild($att);
-
-
-                            } else {
-
-								if (strpos($f['name'], '/') !== false) {
-									 
-									if ($arRootline[0] === $profil['xml_productroottag'] && $arRootline[1] === $profil['xml_producttag']) {
-									
-										$this->addXMLNode($doc, $tag_product, implode('/', array_slice($arRootline, 1)), $value, $f);
-										
-									}  
-									
-								} else {
-								
-	                                $tag = $doc->createElement($this->clearXML($f['name']));
-	                                $tag = $tag_product->appendChild($tag);
-	
-									if (intval($f['format']) === 950) {
-						
-										$tag_value = $doc->createCDATASection($value);
-										
-									} else {
-										
-										$tag_value = $doc->createTextNode(htmlspecialchars($value));
-										
-									} 
-									
-	                                $tag->appendChild($tag_value);
-
-								}
-
-                            }
-
-                        }
-                    }
-
-                    if ($tag_product !== false) {
-
-                        $tag_product_root->appendChild($tag_product);
-
-                    }
-
-                } // foreach Produkte
-
+	            
+				\apply_filters('wpsg_mod_export_xml_order', $tag_order, ['order_id' => $oOrder->getId()]);
+				
 	            $oOrder->setMeta('wpsg_mod_export_order_onetime_'.$profil_id, time());
 	            
@@ -1337,5 +1342,5 @@
 
 	        //Debug Out
-//	        die('<pre>'.htmlspecialchars($doc->saveXML()).'</pre>');
+	        //die('<pre>'.htmlspecialchars($doc->saveXML()).'</pre>');
 	        
             $tmpfname = tempnam($this->getTmpFilePath(), "wpsg");
@@ -1600,4 +1605,5 @@
                         'order_shipping_method' => __('Name der Versandart', 'wpsg'),
                         'order_shipping_tax' => __('Steuerwert (z.b. 19.00) der Versandart', 'wpsg'),
+                        'order_shipping_tax2' => __('Steuerwert (z.b. 0.19) der Versandart', 'wpsg'),
                         'order_count' => __('Anzahl Produkte', 'wpsg'),
                         'order_bname' => __('Name der Bank (Bankeinzug)', 'wpsg'),
@@ -2137,4 +2143,5 @@
                 case 'order_shipping_method': $return = $oOrder->getShippingLabel(); break;
 	            case 'order_shipping_tax': $return = $oOrder->getShippingTaxValue(); break;
+	            case 'order_shipping_tax2': $return = $oOrder->getShippingTaxValue() / 100; break;
                 case 'order_count': $return = $oOrder->getProductCount(); break;
                 case 'order_firma': $return = $oOrder->getInvoiceCompany(); break;
