ECSHOP开发中心在制作模板的过程中想要在详情页面调用该商品所属的商品分类的分类ID和商品名称。通过下面的方法就可以实现了,感兴趣的朋友可以研究看看
第一步:打开goods.php
在页面最下方添加如下方法
1 | function get_cat_info( $cat_id ) |
2 | { |
3 | return $GLOBALS [ 'db' ]->getOne( 'SELECT cat_name FROM ' . $GLOBALS [ 'ecs' ]->table( 'category' ) . |
4 | " WHERE cat_id = '$cat_id'" ); |
5 | } |
第二步:搜索$smarty->assign('goods_rank', ...