From 99ad6481e690aa44499adae19bb2cfa426303151 Mon Sep 17 00:00:00 2001 From: Javsmile Date: Thu, 7 Nov 2013 17:53:47 +0100 Subject: [PATCH] Update productcomments.php This little addition fix the problem for enlight the stars in the hookproductTab whe you disable or make an exception of the hookproductOutOfStock with the product file. --- modules/productcomments/productcomments.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/productcomments/productcomments.php b/modules/productcomments/productcomments.php index ec26dfad2..499bde34f 100644 --- a/modules/productcomments/productcomments.php +++ b/modules/productcomments/productcomments.php @@ -680,11 +680,14 @@ class ProductComments extends Module { require_once(dirname(__FILE__).'/ProductComment.php'); require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + + $average = ProductComment::getAverageGrade((int)Tools::getValue('id_product')); $this->context->smarty->assign(array( 'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'), 'comments' => ProductComment::getByProduct((int)(Tools::getValue('id_product'))), 'criterions' => ProductCommentCriterion::getByProduct((int)(Tools::getValue('id_product')), $this->context->language->id), + 'averageTotal' => round($average['grade']), 'nbComments' => (int)(ProductComment::getCommentNumber((int)(Tools::getValue('id_product')))) ));