- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
$textb = Db::getInstance()->ExecuteS("SELECT * FROM "._DB_PREFIX_."productotzyv WHERE `id_product` = ".$idProduct);
$count_otz = count($textb);
if ($p==0) $p = 1;
$limit = 99;
$texta = get("SELECT *, date_format(data, '%d.%m.%Y') as data_ FROM "._DB_PREFIX_."productotzyv WHERE `id_product` = ".$idProduct." LIMIT ".$limit);
$ed = count(Db::getInstance()->ExecuteS("SELECT * FROM "._DB_PREFIX_."productotzyv WHERE `id_product`=".intval($_GET['id_product'])." and `rating`=1"));
$dva = count(Db::getInstance()->ExecuteS("SELECT * FROM "._DB_PREFIX_."productotzyv WHERE `id_product`=".intval($_GET['id_product'])." and `rating`=2"));
$tri = count(Db::getInstance()->ExecuteS("SELECT * FROM "._DB_PREFIX_."productotzyv WHERE `id_product`=".intval($_GET['id_product'])." and `rating`=3"));
$four = count(Db::getInstance()->ExecuteS("SELECT * FROM "._DB_PREFIX_."productotzyv WHERE `id_product`=".intval($_GET['id_product'])." and `rating`=4"));
$five = count(Db::getInstance()->ExecuteS("SELECT * FROM "._DB_PREFIX_."productotzyv WHERE `id_product`=".intval($_GET['id_product'])." and `rating`=5"));
$uri = $_SERVER['REQUEST_URI'];
$i = strrpos($uri, "/");
$uri1 = substr($uri, 0, $i);
$i = strrpos($uri1, "/");
$uri = substr($uri1, 0, $i);
$uri = $uri."/";
$monUrl = "http://".$_SERVER['HTTP_HOST'].$uri;
foreach ($textb as $s => $a){
$text += $a['rating'];
}
$smarty->assign('ed', $ed);
$smarty->assign('dva', $dva);
$smarty->assign('tri', $tri);
$smarty->assign('four', $four);
$smarty->assign('five', $five);
$smarty->assign('ed_proc', $ed/$count_otz*100);
$smarty->assign('dva_proc', $dva/$count_otz*100);
$smarty->assign('tri_proc', $tri/$count_otz*100);
$smarty->assign('four_proc', $four/$count_otz*100);
$smarty->assign('five_proc', $five/$count_otz*100);
$smarty->assign('rating2', round($text/$count_otz, 0));
$smarty->assign('countotz', $count_otz.' '.endingsForm($count_otz,"отзыв","отзыва","отзывов"));
$smarty->assign('monUrl',$monUrl);
$smarty->assign('text',$texta);
Prestashop, реализация отображения отзывов и рейтига товара
Lure Of Chaos 19.02.2012 12:08 # 0
monDieu
7ion 19.02.2012 12:33 # +5
Кто больше?
istem 20.02.2012 01:10 # 0
volhv 19.02.2012 12:56 # +1
3_dar 08.09.2016 22:49 # 0
bagor 09.09.2016 00:12 # 0
vistefan 19.02.2012 21:04 # 0
actuator 19.02.2012 22:05 # 0
Lure Of Chaos 20.02.2012 01:21 # 0
nikita2206 20.02.2012 20:46 # 0
Bert 20.02.2012 07:16 # +3
guest8 09.04.2019 12:43 # −999