ECSHOP商品详情页如何获取所属分类ID
如何在商品的详情页获取商品所属的上级分类的分类ID呢?下面由的技术来为您解答,在根目录goods.php中找到:
$smarty->assign('goods_rank', get_goods_rank($goods_id));
在这段下面加入
$sql= "select cat_id from ".$GLOBALS['ecs']->table('goods')."where goods_id ='".$goods_id."'";
$thiscat_id = $GLOBALS['db']->getOne($sql);
好啦,$thiscat_id 就是我们所想要的分类的ID啦.

