您现在的位置是:首页 > 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会员购物怎么增加手机注册项
1、打开flow.dwt 默认模板七百多行找到注册的显示的地方加入;2、打开flow.php 301行 修改为
ecshop中收货人信息的省市区怎么设成非必选项
一般面向国外用户的ECSHOP商城,可能会有这方面的需求:【将Ecshop中收货人信息的省市区设成非必选项】,其实也就是只留一个“请选择国家”的下拉选择框。
ecshop商品品牌图片添加设置教程
今天为大家详细解说一下ECSHOP商品品牌添加设置。你可以直接点击某个品牌的品牌的名称、品牌网址、排序后该区域将变为编辑区。编辑完成回车就完成编辑。
ecshop商城Ajax使用方法实例
cshop中的ajax非常好用,当自己 次使用的时候,也非常吃力。当自己用多了的时候,却感觉十分简单,也特别方便。
相关源码
-
(自适应)电梯扶梯升降梯行业pbootcms企业网站模板(自适应手机版)响应式电梯扶梯类pbootcms模板 电梯生产企业绿色企业网站源码下载PbootCMS内核开发的网站模板,该模板适用于电梯、扶梯类等企业,查看源码 -
手机软件APP游戏软件下载网站Pbootcms模板(自适应)基于PbootCMS内核深度开发的网站模板,为移动互联网时代打造。无论是手机APP推广、游戏软件展示,还是各类企业官网需求,本模板都能通过简单的图文替换实现行业无缝切换查看源码 -
自适应电子科技类产品公司pbootcms网站模板基于PbootCMS内核开发,为电子科技类企业设计,适用于电子产品展示、企业官网等场景。该模板采用开源架构,用户可自由访问和修改源码,灵活适配各类行业需求,无需二次开发成本查看源码 -
(自适应)个人图集图片相册画册pbootcms网站模板源码本模板基于PbootCMS系统开发,为图片展示类网站设计,特别适合个人作品集、摄影画册、艺术图集等内容展示。采用响应式布局技术,确保各类图片在不同设备上查看源码 -
(自适应手机端)英文外贸电子产品通用pbootcms模板源码下载为电子产品外贸企业设计的响应式网站模板,采用PbootCMS开发内核,支持多语言展示。模板默认集成产品展示系统、询价表单模块和企业资质展示区,满足跨境贸易基础需求。整站采用模块化设计,便于扩展业务场景。查看源码 -
pbootcms模板PC+WAP娱乐新闻资讯类博客网站源码该模板基于PbootCMS内核开发,专为娱乐新闻、健康生活类资讯网站设计,同时支持快速适配其他行业(如企业官网、博客门户等),仅需替换图文内容即可完成转型。查看源码
| 分享笔记 (共有 篇笔记) |
