ECSHOP商品详情页面显示商品购买记录方法
2016-06-13 13:05 来源:www.chinab4c.com 作者:ecshop专家
实现ECSHOP商品详情页面显示购买记录有些ECSHOP模板开发时候没有带这个商品购买记录,所以需要自己增加下:在goods.php加入 代码$smarty->assign('sale_history', getsales_history($goods_id)); //获取购买历史记录function getsales_history($goods_id){$sql ='select f.consignee, f.order_sn, f.address, g.goods_number,f.add_time FROM '. $GLOBALS['ecs']->table('order_goods') .' as g,'. $GLOBALS['ecs']->table('order_info') .' as f where g.order_id = f.order_id and g.goods_id='.$goods_id;$res = $GLOBALS['db']->getAll($sql);$sales_history = array();foreach ($res AS $idx => $row){ $sales_history[$idx]['name'] = $row['consignee']; $sales_history[$idx]['order_sn'] = $row['order_sn']; $sales_history[$idx]['address'] = $row['address']; $sales_history[$idx]['number'] = $row['goods_number']; // $sales_history[$idx]['add_time'] = local_date("Y-m-d", $row['add_time']); $sales_history[$idx]['add_time'] = local_date($GLOBALS['_CFG']['time_format'], $row['add_time']); } return $sales_history;}在goods.dwt中加入 代码
{$saleitem.address} | {$saleitem.number} | {$saleitem.add_time}
最近更新常用插件
ecshop热门问答ecshop热门资料
ecshop局部
ecshop密码重置
ecshop文章管理
ecshop失望
ecshop谷歌首页
ecshop数据文件
nginx.conf
golang
ecshopthumb
ecshop乐山淘宝网
ecshop编辑运费
ecshop好听的名字
ecshop显示异常
ecshop质量
ecshop400电话
ecshop不写
ecshop图片缓载
ecshop目录树
ecshop指示
ecshop送积分
ecshop客站
ecshopnewrad
ecshop备注栏
ecshop新浪微博
ecshop社区
ecshopgrid
ecshop版板
ecshop添加到购物车
ecshop找人
ecshop找回密码
|