Как сделать отзывы о магазине, вместо отзывов о товаре в блоке на главной?
В файле \includes\modules\main_rev.php
Заменить все на
<?php
$module = '';
if ($main_page_config['SHOW_MAIN_REWIEVS'] && NS\Vars::$current_page['MAIN']) {
$module = new vamTemplate;
//fsk18 lock
$fsk_lock = '';
if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
$fsk_lock = ' and p.products_fsk18!=1';
}
if (!CacheCheck()) {
$module->caching = 0;
} else {
$module->caching = 1;
$module->cache_lifetime = CACHE_LIFETIME;
$module->cache_modified_check = CACHE_CHECK;
}
$cache_id = 'main_rev|'. NS\Vars::getCacheId();
$reviews = array();
if (!$module->isCached(CURRENT_TEMPLATE . '/module/main_rev.html', $cache_id)) {
$reviews_select = "SELECT
r.*,
rd.*
FROM " . TABLE_SITE_REVIEWS. " r,
" . TABLE_SITE_REVIEWS_DESCRIPTION . " rd
WHERE
r.reviews_id = rd.reviews_id
AND r.reviews_rating > 3
AND rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'
ORDER BY r.date_added DESC LIMIT 10";
$reviews_select = vamDBquery($reviews_select);
if (vam_db_num_rows($reviews_select, true) >= 1) {
while ($data = vam_db_fetch_array($reviews_select, true)) {
$reviews_rating = '<i class="icon-' . number_format($data['reviews_rating']) . '-star"></i>';
$data['reviews_text'] = NS\Form::prepareTextSite($data['reviews_text']);
$data['reviews_plus'] = NS\Form::prepareTextSite($data['reviews_text']);
$products_image = !empty($data['products_image']) ? DIR_WS_THUMBNAIL_IMAGES . $data['products_image'] : '';
if (!file_exists($products_image)){
$products_image = DIR_WS_INFO_IMAGES.'../noimage.gif';
}
$size = getimagesize($products_image);
$reviews[] = array(
'reviews_id' => $data['reviews_id'],
'reviews_rating' => $reviews_rating,
'date_added' => vam_date_short($data['date_added']),
'reviews_text' => !empty($data['reviews_plus']) ? crop_str_nexoos($data['reviews_plus'], 140) : crop_str_nexoos($data['reviews_text'], 140),
'customers_name' => $data['customers_name'],
// 'products_id' => $data['products_id'],
// 'products_name' => $data['products_name'],
'products_image' => $products_image,
'products_image_width' => $size[0],
'products_image_height' => $size[1],
'link_to_rev_product' => NS\Vars::getLink(FILENAME_SITE_REVIEWS),
);
}
$module->assign('reviews', $reviews);
}
}
$module = $module->fetch(CURRENT_TEMPLATE . '/module/main_rev.html', $cache_id);
}
$vamTemplate->assign('MODULE_main_rev', $module);
?>
и в файле
\templates\nexshops\module\main_rev.html
заменить
reviews.php
на
site_reviews.php
В админке Nexoos - Настройки - Дополнительный css
добавить
#rev_slider_wrap{
.rev_img{
display: none;
}
.rev_data{
width: 100%;
}
}
Благодарю, всё получилось!
1 лайк