免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
历史浏览、购买了该商品的人还买了、相关联产品模块增加“市场价格”ecshop模板堂() 一、历史浏览模块增加市场价格: 打开include/lin_insert.php 直接替换下面这段函数/* * 调用浏览历史 * * access public * return string */ function insert_history() $str = ; if (!empty($_COOKIEECShistory) $where = db_create_in($_COOKIEECShistory, goods_id); $sql = SELECT goods_id, goods_name, goods_thumb, shop_price, market_price FROM . $GLOBALSecs-table(goods) . WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0; $query = $GLOBALSdb-query($sql); $res = array(); while ($row = $GLOBALSdb-fetch_array($query) $goodsgoods_id = $rowgoods_id; $goodsgoods_name = $rowgoods_name; $goodsshort_name = $GLOBALS_CFGgoods_name_length 0 ? sub_str($rowgoods_name, $GLOBALS_CFGgoods_name_length) : $rowgoods_name; $goodsgoods_thumb = get_image_path($rowgoods_id, $rowgoods_thumb, true); $goodsshop_price = price_format($rowshop_price); $goodsmarket_price = price_format($rowmarket_price); $goodsurl = build_uri(goods, array(gid=$rowgoods_id), $rowgoods_name); $str.=ul class=clearfixli class=goodsimga href=.$goodsurl. target=_blankimg src=.$goodsgoods_thumb. alt=.$goodsgoods_name. class=B_blue /a/lilia href=.$goodsurl. target=_blank title=.$goodsgoods_name.$goodsshort_name./abr /.原价:.$goodsmarket_price.br /.现价:.font class=f1.$goodsshop_price./fontbr /li/ul; $str .= ul id=clear_historya onclick=clear_history() . $GLOBALS_LANGclear_history . /a/ul; return $str; 二、购买过该商品的朋友还购买了模块增加市场价格: 打开goods.php 直接替换以下函数 /* * 获得购买过该商品的人还买过的商品 * * access public * param integer $goods_id * return array */ function get_also_bought($goods_id) $sql = SELECT COUNT(b.goods_id ) AS num, g.goods_id, g.goods_name, g.goods_thumb, g.goods_img, g.shop_price, g.market_price, mote_price, mote_start_date, mote_end_date . FROM . $GLOBALSecs-table(order_goods) . AS a . LEFT JOIN . $GLOBALSecs-table(order_goods) . AS b ON b.order_id = a.order_id . LEFT JOIN . $GLOBALSecs-table(goods) . AS g ON g.goods_id = b.goods_id . WHERE a.goods_id = $goods_id AND b.goods_id $goods_id AND g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 . GROUP BY b.goods_id . ORDER BY num DESC . LIMIT . $GLOBALS_CFGbought_goods; $res = $GLOBALSdb-query($sql); $key = 0; $arr = array(); while ($row = $GLOBALSdb-fetchRow($res) $arr$keygoods_id = $rowgoods_id; $arr$keygoods_name = $rowgoods_name; $arr$keyshort_name = $GLOBALS_CFGgoods_name_length 0 ? sub_str($rowgoods_name, $GLOBALS_CFGgoods_name_length) : $rowgoods_name; $arr$keygoods_thumb = get_image_path($rowgoods_id, $rowgoods_thumb, true); $arr$keygoods_img = get_image_path($rowgoods_id, $rowgoods_img); $arr$keyshop_price = price_format($rowshop_price); $arr$keymarket_price = price_format($rowmarket_price); $arr$keyurl = build_uri(goods, array(gid=$rowgoods_id), $rowgoods_name); if ($rowpromote_price 0) $arr$keypromote_price = bargain_price($rowpromote_price, $rowpromote_start_date, $rowpromote_end_date); $arr$keyformated_promote_price = price_format($arr$keypromote_price); else $arr$keypromote_price = 0; $key+; return $arr; 然后再
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学三年级读书心得
- 营改增有关情况介绍(协会)
- 走进神奇的稀土世界智慧树知到期末考试答案2024年
- 转基因的科学-基因工程智慧树知到期末考试答案2024年
- 中药养颜秘籍智慧树知到期末考试答案2024年
- 中级财务会计1智慧树知到期末考试答案2024年
- 餐饮场所消防安全培训
- 初中作文600字作文大全【5篇】
- 循环水泵岗位操作安全规程
- 职业安全健康管理体系在全球的进展
- 猎头招聘渠道评价及管理制度
- 小学语文课外分层作业课题研究.结题报告【范本模板】
- GB/T 231.2-2002金属布氏硬度试验第2部分:硬度计的检验与校准
- GB/T 11832-2002翻斗式雨量计
- GB 24500-2020工业锅炉能效限定值及能效等级
- 支气管肺泡灌洗术
- 充电桩检测报告模板
- 圆柱的表面积练习-课件
- 水利工程建设项目招标投标课件
- 马拉松培训-心肺复苏课件
- 始祖鸟新员工基础知识考试(NEW)试题含答案
评论
0/150
提交评论