历史浏览、购买了该商品的人还买了、相关联产品模块增加“市场价格”.doc_第1页
历史浏览、购买了该商品的人还买了、相关联产品模块增加“市场价格”.doc_第2页
历史浏览、购买了该商品的人还买了、相关联产品模块增加“市场价格”.doc_第3页
免费预览已结束,剩余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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论