ECshop--商品详情页查看该分类下所有商品
在商品详情页,要实现查看该分类下所有商品,应该获得此商品的分类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);
- $smarty->assign('thiscat_id', &thiscat_id);
在根目录goods.dwt中,修改"查看该分类下所有商品"的链接为 href="category.php?id={$thiscat_id}".

