Merge pull request #945 from Javsmile/patch-2
// Update productcomments.php
This commit is contained in:
@@ -680,11 +680,14 @@ class ProductComments extends Module
|
|||||||
{
|
{
|
||||||
require_once(dirname(__FILE__).'/ProductComment.php');
|
require_once(dirname(__FILE__).'/ProductComment.php');
|
||||||
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
|
||||||
|
|
||||||
|
$average = ProductComment::getAverageGrade((int)Tools::getValue('id_product'));
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
|
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
|
||||||
'comments' => ProductComment::getByProduct((int)(Tools::getValue('id_product'))),
|
'comments' => ProductComment::getByProduct((int)(Tools::getValue('id_product'))),
|
||||||
'criterions' => ProductCommentCriterion::getByProduct((int)(Tools::getValue('id_product')), $this->context->language->id),
|
'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'))))
|
'nbComments' => (int)(ProductComment::getCommentNumber((int)(Tools::getValue('id_product'))))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user