netreviews suite

This commit is contained in:
Nolwenn 2016-03-18 17:38:54 +01:00
parent 96ae4ed3bc
commit 2137e3efc1
4 changed files with 17 additions and 4 deletions

View File

@ -2047,7 +2047,7 @@ class AdminControllerCore extends Controller
* Init tab modules list and add button in toolbar
*/
protected function initTabModuleList()
{
{ return false;
if (!$this->isFresh(Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, 86400)) {
@file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'));
}

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>netreviews</name>
<displayName><![CDATA[Verified Reviews]]></displayName>
<version><![CDATA[7.1.4]]></version>
<description><![CDATA[Collect service and product reviews with Verified Reviews. Display reviews on your shop and win the trust of your visitors, to increase your revenue.]]></description>
<author><![CDATA[NetReviews]]></author>
<tab><![CDATA[advertising_marketing]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall Verified Reviews module?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@ -495,7 +495,7 @@ class NetReviews extends Module
$stats_product = (!isset($this->stats_product) || empty($this->stats_product)) ?
$o_av->getStatsProduct($id_product, $this->group_name, $this->context->shop->getContextShopID())
: $this->stats_product;
if ($stats_product['nb_reviews'] < 1 || $display_prod_reviews != 'yes') {
if ($stats_product['nb_reviews'] < 1) {
return ''; /* if no reviews, return empty */
}
$reviews = $o_av->getProductReviews($id_product, $this->group_name, $this->context->shop->getContextShopID(), false, 0);
@ -659,7 +659,7 @@ class NetReviews extends Module
$id_product = (int)Tools::getValue('id_product');
$o = new NetReviewsModel();
$reviews = $o->getStatsProduct($id_product, $this->group_name, $this->context->shop->getContextShopID());
if ($reviews['nb_reviews'] < 1 || $display_prod_reviews != 'yes') {
if ($reviews['nb_reviews'] < 1) {
return ''; //Si Aucun avis, on retourne vide
}
$percent = round($reviews['rate']) * 20;

View File

@ -46,7 +46,7 @@ class FrontController extends FrontControllerCore
$this->js_files[$key] = $file.'?v='.filemtime($this->getThemeDir().'js/'.str_replace(_THEME_JS_DIR_, '', $file));
}
$this->js_files[] = _MODULE_DIR_.'netreviews/views/js/avisverifies.js';
/****************************/
$this->context->smarty->assign(array(