ecshop二次开发评论列表调用商品信息

2010-07-16 10:52 来源:www.chinab4c.com 作者:admin

ecshop评论中调用商品图片和商品名称。
1:goods.php中
$smarty->assign('goods_com',$info);
2:includes/lib_goods.php的function get_goods_info($goods_id)
$row['url'] =  build_uri('goods', array('gid'=>$row['goods_id']), $row['goods_name']);
3:includes/lib_main.php
function assign_comment($id, $type, $page = 1)

修改成
$info = $GLOBALS['db']->getRow("select goods_id ,goods_name,goods_thumb from ".$GLOBALS['ecs']->table('goods')." where goods_id = '$id'");
 $info['goods_thumb'] = get_image_path($id, $info['goods_thumb'],true);
 $info['url']        = build_uri('goods', array('gid' => $id), $info['goods_name']);
 
 $GLOBALS['smarty'] ->assign('goods_com',$info);


4:includes/lib_insert.php
function insert_comments($arr)
$info = $GLOBALS['db']->getRow("select goods_id ,goods_name,goods_thumb from ".$GLOBALS['ecs']->table('goods')." where goods_id = '$arr[id]'");
 $info['goods_thumb'] = get_image_path($arr[id], $info['goods_thumb'],true);
 $info['url']        = build_uri('goods', array('gid' => $arr['id']), $info['goods_name']);
 
 $GLOBALS['smarty'] ->assign('goods_com',$info);

以上修改就完成了ecshop评论中的ecshop ajax数据调用中实现商品信息的调用。

来源:http://www.chinab4c.com