您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程
ecshop商品详情页面显示商品购买记录方法
水桃2024-01-16Ecshop商城教程已有人查阅
导读实现ECSHOP商品详情页面显示购买记录有些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中加入 代码
<table width=" " cellpadding="5" cellspacing="1"> 历史购买记录 名字 订单号 地址 数量 日期
{$saleitem.name} {$saleitem.order_sn} <td align="center">{$saleitem.address} <td align="center">{$saleitem.number} <td align="center">{$saleitem.add_time}
在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中加入 代码
<table width=" " cellpadding="5" cellspacing="1"> 历史购买记录 名字 订单号 地址 数量 日期
{$saleitem.name} {$saleitem.order_sn} <td align="center">{$saleitem.address} <td align="center">{$saleitem.number} <td align="center">{$saleitem.add_time}
本文标签:
很赞哦! ()
相关教程
图文教程
ecshop后台登陆后一段时间不操作就超时怎么办
客户生意比较好,因此比较忙,常常不在电脑前,经常打开后台长时间不操作,等回到电脑前操作时,每次都超时,需要从新登陆,因此,客户希望后台的登录时间尽量长些
ecshop商城ajax调用参数说明
1、首先ecshop是如何定义ajax对象的。2、ecshop中ajax可以使用两种方式传递数据.一种是get方式,一种是post方式.3、ecshop中的 ajax可以是传递text数据,也可以是一个json对象。比如以下代码
ecshop购物车页面继续购物按钮怎么改成回到上一步
ecshop购物车页面继续购物按钮改成回到上一步的修改方法:大家都知道,ecshop 的购物车页面有的继续购物按钮是返回到首页的,而这样是非常不利于用户体验的
ecshop产品重量单位千克怎么改成默认单位克
ecshop后台增加产品的时候,往往需要调整产品重量,调整产品重量单位,ecshop产品重量单位的存储,有很多的缺点和漏洞,比如填写"克",小数点不能保留到最后两位
相关源码
-
(自适应响应式)电子数码科技产品介绍带留言网站模板下载为电子产品企业设计的展示系统,集成智能产品对比器、参数规格表和展示模块。支持消费电子、智能设备等多级分类展示,内置产品技术参数数据库。查看源码 -
(自适应)家禽饲养养殖基地pbootcms模板响应式模板下载为家禽饲养企业、养殖基地设计的响应式网站模板,聚焦畜禽产品展示、养殖技术分享及企业信息服务。采用PbootCMS内核开发,响应式技术确保PC与手机端数据实时同步查看源码 -
(自适应)五金配件机械蓝色营销型pbootcms模板免费下载基于PbootCMS的工业配件展示系统,精简DIV+CSS架构确保响应速度,自适应设计呈现参数表格,支持后台实时更新产品规格、在线留言等内容。查看源码 -
(自适应)蓝色厨卫厨房水龙头阀门水槽设备源码下载基于PbootCMS内核开发,深度适配厨卫设备行业特性。通过精准的产品展示模块与水效标识专区设计,有效呈现五金件工艺细节。响应式布局确保从手机到平板都能展示金属质感与水流动态效果。查看源码 -
帝国cms题库问答学习平台模板知识付费网站源码+数据采集为教育机构、培训平台及在线学习场景设计,提供完整的题库管理与问答服务解决方案。支持多种题型展示与答案查询,满足不同层次的学习需求。查看源码 -
(自适应响应式)HTML5中小学早教教育机构类网站pbootcms模板下载基于PbootCMS内核开发的响应式模板,为早教中心、培训学校等教育机构打造,提供从技术架构到视觉呈现的全套网站建设方案。查看源码
| 分享笔记 (共有 篇笔记) |
