您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

ecshop商品详情页怎么显示收藏数量

夏落兴2023-12-11 17:26:39ecshop商城教程已有人查阅

导读众所周知,很新版的商品详情页, 已经能够显示购买数量、评论数量了,但是唯独没有显示收藏数量,也就是淘宝上的收 气,下面我们就把它显示出来。

众所周知,很新版的商品详情页, 已经能够显示购买数量、评论数量了,但是唯独没有显示收藏数量,也就是淘宝上的收 气,下面我们就把它显示出来。
1)、首先打开 /includes/lib_insert.php  文件
在文件末尾增加下面代码
/**
* 调用某商品的累积收藏
*/
function insert_goods_collect($arr)
{
$sql='select count(user_id) as ids '.'from '. $GLOBALS['ecs']->table('collect_goods')."as co "."where co.goods_id=".$arr['goods_id'];
$row=$GLOBALS['db']->GetRow($sql);
if($row)
{
$ids = intval($row['ids']);
}
else
{
$ids = 0;
}
return $ids;
}
2)、接着打开模板文件 /themes/default/goods.dwt ,这里以官方默认模板(2.7.2版)为例在
<strong>{$lang.goods_rank}</strong>
上边添加
<strong>收气:</strong>{insert name='goods_collect' goods_id=$id}人<br>

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签