AntonLV 9 лет назад
Родитель
Сommit
83785adb27

+ 0 - 1
studio/template/css/store.css

@@ -174,7 +174,6 @@ span.bx-std-product-versions {
     background-size:cover;
     background-repeat:no-repeat;
     background-position:center center;
-    display:table;
     width:100%;
 }
 .bx-std-product-strecher {

+ 26 - 2
studio/template/scripts/BxBaseStudioStore.php

@@ -526,6 +526,7 @@ class BxBaseStudioStore extends BxDolStudioStore
 
     protected function getProduct($sModuleName)
     {
+        $bShowRating = true;
         $sJsObject = $this->getPageJsObject();
         $oTemplate = BxDolStudioTemplate::getInstance();
 
@@ -562,6 +563,19 @@ class BxBaseStudioStore extends BxDolStudioStore
                 );
         }
 
+		$bTmplVarsRate = $bShowRating;
+		if($bTmplVarsRate)
+		    $aTmplVarsRate = array(
+		        'rate' => $this->getVoteStars($aProduct)
+		    );
+
+		$aTmplVarsVotes = array();
+		$bTmplVarsVotes = $bShowRating && (int)$aProduct['votes_cnt'] > 0;
+		if($bTmplVarsVotes)
+		    $aTmplVarsVotes = array(
+		        'count' => (int)$aProduct['votes_cnt']
+		    );
+
         $sContent = $oTemplate->parseHtmlByname('str_product_view.html', array(
             'id' => $aProduct['id'],
             'title' => $aProduct['title'],
@@ -587,6 +601,14 @@ class BxBaseStudioStore extends BxDolStudioStore
 					'price_recurring' => _t('_adm_str_txt_price_recurring', $aProduct['author_currency_sign'], $aProduct['price_recurring'], _t('_adm_str_txt_per_' . $aProduct['duration_recurring']))
         		)
         	),
+        	'bx_if:show_rate' => array(
+                'condition' => $bTmplVarsRate,
+                'content' => $aTmplVarsRate
+            ),
+            'bx_if:show_votes' =>  array(
+                'condition' => $bTmplVarsVotes,
+                'content' => $aTmplVarsVotes
+            ),
             'category' => $aProduct['category'],
             'category_url' => $aProduct['category_url'],
             'tags' => implode(', ', explode(',', $aProduct['tags'])),
@@ -683,6 +705,8 @@ class BxBaseStudioStore extends BxDolStudioStore
 
     protected function displayProducts($mixedItems, $aParams = array())
     {
+        $bShowRating = false;
+
         if(!is_array($mixedItems))
             return MsgBox($mixedItems);
 
@@ -717,14 +741,14 @@ class BxBaseStudioStore extends BxDolStudioStore
 			$bImage = strpos($sImage, '.') !== false;
 
 			$aTmplVarsRate = array();
-			$bTmplVarsRate = !$bShoppingCart;
+			$bTmplVarsRate = $bShowRating && !$bShoppingCart;
 			if($bTmplVarsRate)
 			    $aTmplVarsRate = array(
 			        'rate' => $this->getVoteStars($aItem)
 			    );
 
 			$aTmplVarsVotes = array();
-			$bTmplVarsVotes = !$bShoppingCart && (int)$aItem['votes_cnt'] > 0;
+			$bTmplVarsVotes = $bShowRating && !$bShoppingCart && (int)$aItem['votes_cnt'] > 0;
 			if($bTmplVarsVotes)
 			    $aTmplVarsVotes = array(
 			        'count' => (int)$aItem['votes_cnt']

+ 4 - 0
studio/template/str_product_view.html

@@ -16,6 +16,10 @@
 			</div>
 		</div>
 	</bx_if:show_screenshots>
+	<div class="bx-std-pv-line">
+        <bx_if:show_rate>__rate__</bx_if:show_rate>
+        <bx_if:show_votes><span class="bx-std-pt-votes">__count__</span></bx_if:show_votes>
+	</div>
 	<div class="bx-std-pv-line">
 		<span class="bx-std-pv-cpt bx-def-font-grayed">
 			<bx_text:_adm_str_txt_pv_title />: