Index: /controller/wpsg_SystemController.class.php
===================================================================
--- /controller/wpsg_SystemController.class.php	(revision 7878)
+++ /controller/wpsg_SystemController.class.php	(revision 7879)
@@ -130,6 +130,5 @@
 		 * FÃŒhrt eine Header Weiterleitung durch. Es darf vorher keine Ausgabe erfolgen (logischerweise)
 		 */
-		public function redirect($url) 
-		{
+		public function redirect($url) {
 
 			header('Location: '.html_entity_decode($url));
Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 7878)
+++ /lib/wpsg_calculation.class.php	(revision 7879)
@@ -1153,5 +1153,5 @@
 		
         public function fromDB($id) {
-            
+
 			if (!wpsg_isSizedInt($id)) return;
 			
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 7878)
+++ /model/wpsg_product.class.php	(revision 7879)
@@ -739,6 +739,12 @@
 		}
 
-		public static function find($arFilter = array(), $load = true)
-		{
+		/**
+		 * @param array $arFilter
+		 * @param bool $load
+		 *
+		 * @return wpsg_product[]
+		 * @throws \wpsg\Exception
+		 */
+		public static function find($arFilter = array(), $load = true) {
 
 			list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = self::getQueryParts($arFilter);
Index: /mods/mod_gutschein/wpsg_voucher.php
===================================================================
--- /mods/mod_gutschein/wpsg_voucher.php	(revision 7878)
+++ /mods/mod_gutschein/wpsg_voucher.php	(revision 7879)
@@ -51,5 +51,5 @@
         public function getUsed() {
 
-			return intval($this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_ORDER."` WHERE `gs_id` = '".wpsg_q($this->id)."' "));
+			return intval($this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_ORDER."` WHERE `gs_id` = '".wpsg_q($this->id)."' ".$strQueryWHERE));
 			
         }
@@ -58,12 +58,20 @@
 	
 			if ($taxView === false) $taxView = $this->shop->getBackendTaxview();
-			
+
+			$strQueryWHERE = "";
+
+			if (isset($_SESSION['wpsg']['order_id'])) {
+
+				$strQueryWHERE .= " AND `order_id` != '".wpsg_q($_SESSION['wpsg']['order_id'])."' ";
+
+			}
+
 			if ($taxView === WPSG_NETTO) {
 				
-				return abs(wpsg_tf($this->db->fetchOne("SELECT SUM(`sum_netto`) FROM `".WPSG_TBL_ORDER_VOUCHER."` WHERE `voucher_id` = '".wpsg_q($this->getId())."' ")));
+				return abs(wpsg_tf($this->db->fetchOne("SELECT SUM(`sum_netto`) FROM `".WPSG_TBL_ORDER_VOUCHER."` WHERE `voucher_id` = '".wpsg_q($this->getId())."' ".$strQueryWHERE)));
 				
 			} else if ($taxView === WPSG_BRUTTO) {
 				
-				return abs(wpsg_tf($this->db->fetchOne("SELECT SUM(`sum_brutto`) FROM `".WPSG_TBL_ORDER_VOUCHER."` WHERE `voucher_id` = '".wpsg_q($this->getId())."' ")));
+				return abs(wpsg_tf($this->db->fetchOne("SELECT SUM(`sum_brutto`) FROM `".WPSG_TBL_ORDER_VOUCHER."` WHERE `voucher_id` = '".wpsg_q($this->getId())."' ".$strQueryWHERE)));
 				
 			} else throw new \Exception(__('Nicht definiert.', 'wpsg'));
Index: /mods/wpsg_mod_gutschein.class.php
===================================================================
--- /mods/wpsg_mod_gutschein.class.php	(revision 7878)
+++ /mods/wpsg_mod_gutschein.class.php	(revision 7879)
@@ -138,13 +138,13 @@
 		
 		public function calculation_fromSession(&$oCalculation, $product_done, $payship_done) { 
-		 
+
 			if ($product_done && $payship_done) {
 
-				if (wpsg_isSizedArray($_SESSION['wpsg']['gs'])) {
+				if (isset($_SESSION['wpsg']['gs']) && wpsg_isSizedArray($_SESSION['wpsg']['gs'])) {
 					
 					foreach ($_SESSION['wpsg']['gs'] as $gs) {
 
 						$oVoucher = wpsg_voucher::getInstance($gs['id']);
-						
+
 						if ($oVoucher->isUsabel()) {
 
@@ -689,4 +689,6 @@
 		public function basket_preInsert() {
 
+			if (!isset($_SESSION['wpsg']['gs'][0]['id'])) return;
+
 			$gs_id = wpsg_getInt($_SESSION['wpsg']['gs'][0]['id']);
 
@@ -752,5 +754,5 @@
 
 			if (!wpsg_isSizedArray($arBasket['gs'])) return true;
-			if (!wpsg_isSizedInt($_SESSION['wpsg']['gs']['id']))  throw new \wpsg\Exception(__('In der Session ist keine ID fÃŒr den Gutschein im Basket Array, sollte nicht passieren', 'wpsg'));
+			//if (!wpsg_isSizedInt($_SESSION['wpsg']['gs']['id']))  throw new \wpsg\Exception(__('In der Session ist keine ID fÃŒr den Gutschein im Basket Array, sollte nicht passieren', 'wpsg'));
 
 			$gs_db = $this->db->fetchRow("SELECT G.`id`, G.`minvalue` FROM `".WPSG_TBL_GUTSCHEIN."` AS G WHERE G.`id` = '".wpsg_q($_SESSION['wpsg']['gs']['id'])."'");
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 7878)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 7879)
@@ -1250,4 +1250,40 @@
 
 			return $price;
+		}
+
+		/**
+		 * Mit dieser Funktion kann eine golbale Produktvariante fÃŒr alle Downloadplus Produkte gesetzt oder deaktiviert werden
+		 */
+		private function admin_wpsg_mod_downloadplus_setProductsAction() {
+
+			$variation_id = intval($_REQUEST['vari_id']);
+			$active = intval($_REQUEST['active']);
+
+			$nUpdated = 0;
+
+			foreach (wpsg_product::find() as $oProduct) {
+
+				if ($this->shop->callMod('wpsg_mod_downloadplus','isPDFProdukt', [$oProduct->getId()])) {
+
+					$exist_id = intval($this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_PRODUCTS_VARIATION."` WHERE `product_id` = '".wpsg_q($oProduct->getId())."' AND `variation_id` = '".wpsg_q($variation_id)."' "));
+
+					$db_data = [
+						'active' => M1::q($active)
+					];
+
+					if ($exist_id > 0) $this->db->UpdateQuery(WPSG_TBL_PRODUCTS_VARIATION, $db_data, " `id` = '".M1::q($exist_id)."' ");
+					else $this->db->ImportQuery(WPSG_TBL_PRODUCTS_VARIATION, [
+						'product_id' => M1::q($oProduct->getId()),
+						'variation_id' => M1::q($variation_id)
+					] + $db_data);
+
+					$nUpdated ++;
+
+				}
+
+			}
+
+			echo wpsg_translate(__('#1# Produkt(e) aktualisiert.', 'wpsg'), $nUpdated); exit;
+
 		}
 
Index: /views/mods/mod_productvariants/admin_edit.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_edit.phtml	(revision 7878)
+++ /views/mods/mod_productvariants/admin_edit.phtml	(revision 7879)
@@ -305,8 +305,37 @@
                         </script>
 
+                        <?php if (intval($this->view['product_id']) <= 0) { ?>
+                        <span style="padding-left:15px;">
+                            <span style="display:inline-block; margin-right:5px;"><?php echo __('FÃŒr alle Downloadplus Produkte:', 'wpsg'); ?></span>
+                            <a onclick="return wpsg_mod_downloadplus_setProducts(<?php echo $vari['id']; ?>, '1');" href="#" style="display:inline-block;"><?php echo __('aktivieren', 'wpsg'); ?></a>
+                            <span style="margin:0 3px; text-align:center;">/</span>
+                            <a onclick="return wpsg_mod_downloadplus_setProducts(<?php echo $vari['id']; ?>, '0');" href="#" style="display:inline-block;"><?php echo __('deaktivieren', 'wpsg'); ?></a>
+                        </span>
+                        <?php } ?>
+
                     </div>
                     <?php } ?>
 					
 					<script>
+
+                        function wpsg_mod_downloadplus_setProducts(vari_id, active) {
+
+                        	jQuery.ajax( {
+                                url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_wpsg_mod_downloadplus_setProducts&noheader=1',
+                                async: false,
+                                data: {
+                                    vari_id: vari_id,
+                                    active: active
+                                },
+                                success: function(data) {
+
+                                    if (data != '1') alert(data);
+
+                                }
+                            } );
+
+                        	return false;
+
+                        }
 
 						jQuery(document).ready(function() {   
Index: /wpshopgermany.php
===================================================================
--- /wpshopgermany.php	(revision 7878)
+++ /wpshopgermany.php	(revision 7879)
@@ -1,4 +1,4 @@
 <?php
-	
+
 	/*
 	Plugin Name: wpShopGermany
