Index: /lib/filter_functions.inc.php
===================================================================
--- /lib/filter_functions.inc.php	(revision 6597)
+++ /lib/filter_functions.inc.php	(revision 6601)
@@ -431,5 +431,5 @@
 					$wpsg_update_data = $wpsg_update_data_return;
 					$wpsg_update_data['updateData'] = (object)$wpsg_update_data['updateData'];
-				 
+					 
                     $GLOBALS['wpsg_sc']->update_option('wpsg_lastupdate', strval(time()), true);
                     $GLOBALS['wpsg_sc']->update_option('wpsg_updatedata', $wpsg_update_data, true);
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 6597)
+++ /model/wpsg_product.class.php	(revision 6601)
@@ -14,5 +14,5 @@
 		private $loadedData = array(); /* EnthÃ€lt die Daten, die ÃŒber den ShopController und die Module geladen / erweitert wurden */
 
-		public $product_key = "";
+		public $product_key = "";		
 
 		/**
@@ -482,4 +482,67 @@
 		} // public function hasLimitedShipping()
 
+		public function getRating()
+		{
+			 
+			if (!isset($this->loadedData['rating_calculated']))
+			{
+				
+				if (!isset($this->loadedData['rating'])) $this->loadedData['rating_calculated'] = 0;
+				else
+				{
+					
+					if ($this->loadedData['rating'] === '-1')
+					{
+						
+						$arApprovedComments = \get_comments(array(
+							'post_id' => $this->GetPostID(),
+							'type' => 'wpsg_product_comment',
+							'status' => 'approve'
+						));
+						
+						$point = 0;
+						$nPointSet = 0;
+						
+						foreach ($arApprovedComments as $oWP_Comment)
+						{
+							
+							$comment_point = intval(get_comment_meta($oWP_Comment->comment_ID, 'sto_points', true));
+							
+							if ($comment_point > 0)
+							{
+								
+								$point += $comment_point;
+								$nPointSet ++;
+								
+							}
+							
+						}
+								 				
+						$this->loadedData['rating_calculated'] = $point / $nPointSet;
+						
+					}
+					else
+					{
+						
+						$this->loadedData['rating_calculated'] = $this->loadedData['rating'];
+						
+					}
+					
+				}
+				
+			}
+			
+			return $this->loadedData['rating_calculated'];
+			
+		}
+		
+		public function getPostID()
+		{
+			
+			if (!isset($this->loadedData['post_id'])) return false;
+			else return $this->loadedData['post_id'];
+			
+		} // public function getPostID()
+		
 		/**
 		 * Gibt einen Array mit IDs von Versandarten zurÃŒck, die fÃŒr dieses Produkt erlaubt sind
@@ -539,5 +602,5 @@
 
 		}
-
+		
 		/* Statische Funktionen */
 
Index: /mods/wpsg_mod_produktartikel.class.php
===================================================================
--- /mods/wpsg_mod_produktartikel.class.php	(revision 6597)
+++ /mods/wpsg_mod_produktartikel.class.php	(revision 6601)
@@ -738,17 +738,7 @@
 			$product_id = $this->shop->getProduktId($produkt_data['id']);
 
-			$post_id = $this->db->fetchOne("
-				SELECT
-					`id`
-				FROM
-					`".$this->shop->prefix."posts`
-				WHERE
-					`wpsg_produkt_id` = '".wpsg_q($product_id)."' AND
-					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
-			");
-
 			$post_data = $this->db->fetchRow("
 				SELECT
-					`id`, `menu_order`
+					`id`, `menu_order`, `comment_status`
 				FROM
 					`".$this->shop->prefix."posts`
@@ -778,4 +768,5 @@
 					'pos' => $post_data['menu_order'],
 					'url' => get_permalink($post_id),
+					'comment_status' => $post_data['comment_status'],
 					'arCat' => $arCat
 				));
@@ -965,5 +956,5 @@
 				if ($comment_status !== false) $data['comment_status'] = wpsg_q(((wpsg_isSizedInt($comment_status))?'open':'closed'));
 				if ($menu_order !== false) $data['menu_order'] = $menu_order;
-				
+			
 				if ($post_id <= 0)
 				{
@@ -975,5 +966,5 @@
 				else
 				{
-
+ 
 					$this->db->UpdateQuery($this->shop->prefix.'posts', $data, "`id` = '".wpsg_q($post_id)."'");
 
Index: /views/mods/mod_produktartikel/produkt_addedit_content.phtml
===================================================================
--- /views/mods/mod_produktartikel/produkt_addedit_content.phtml	(revision 6597)
+++ /views/mods/mod_produktartikel/produkt_addedit_content.phtml	(revision 6601)
@@ -26,5 +26,5 @@
 	
 	<?php echo wpsg_drawForm_Input('wpsg_produktartikel_menuorder', __('Position', 'wpsg'), wpsg_getStr($this->view['data']['menu_order'])); ?>
-	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel[kommentare]', __('Kommentare', 'wpsg'), wpsg_getStr($this->view['data']['comment_status'])); ?>
+	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel[kommentare]', __('Kommentare', 'wpsg'), wpsg_isSizedString($this->view['data']['comment_status'], 'open')); ?>
 	
 	<br />
Index: /views/produkt/addedit_general.phtml
===================================================================
--- /views/produkt/addedit_general.phtml	(revision 6597)
+++ /views/produkt/addedit_general.phtml	(revision 6601)
@@ -58,5 +58,7 @@
 
 	<?php if (!isset($_REQUEST['wpsg_lang'])) { ?>
-		<?php echo wpsg_drawForm_Select('rating', __('Bewertungspunkte', 'wpsg'), array('0', '1', '2', '3', '4', '5'), wpsg_getInt($this->view['data']['rating'])); ?>
+		<?php $arSelect = array('0' => __('Nicht anzeigen', 'wpsg'), '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'); ?>	
+		<?php if (defined('STO_PATH')) $arSelect['-1'] = __('Aus Kommentarbewertung', 'wpsg'); ?>
+		<?php echo wpsg_drawForm_Select('rating', __('Bewertungspunkte', 'wpsg'), $arSelect, wpsg_getInt($this->view['data']['rating'])); ?>
 	<?php } ?>
 
Index: /views/warenkorb/messageDialog.phtml
===================================================================
--- /views/warenkorb/messageDialog.phtml	(revision 6597)
+++ /views/warenkorb/messageDialog.phtml	(revision 6601)
@@ -14,5 +14,5 @@
 		<?php echo wpsg_getStr($this->view['content']); ?>
 		<br />
-		<input type="button" id="wpsg_basket_messageDialog_closeButton" value="<?php echo __('SchlieÃen', 'wpsg'); ?>" />			
+		<a id="wpsg_basket_messageDialog_closeButton" class="fa fa-times"></a>			
 	</div> 
 					
