麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 網站 > 建站經驗 > 正文

ecshop歷史瀏覽、購買了該商品的人還買了、相關聯產品模塊增加“市場價格”

2024-04-25 20:44:04
字體:
來源:轉載
供稿:網友

一、歷史瀏覽模塊增加市場價格:

打開include/lin_insert.php 直接替換下面這段函數

/**

* 調用瀏覽歷史

*

* @access public

* @return string

*/

function insert_history()

{

$str = '';

if (!empty($_COOKIE['ECS']['history']))

{

$where = db_create_in($_COOKIE['ECS']['history'], 'goods_id');

$sql = 'SELECT goods_id, goods_name, goods_thumb, shop_price, market_price FROM ' . $GLOBALS['ecs']->table('goods') .

" WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0";

$query = $GLOBALS['db']->query($sql);

$res = array();

while ($row = $GLOBALS['db']->fetch_array($query))

{

$goods['goods_id'] = $row['goods_id'];

$goods['goods_name'] = $row['goods_name'];

$goods['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name'];

$goods['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);

$goods['shop_price'] = price_format($row['shop_price']);

$goods['market_price'] = price_format($row['market_price']);

$goods['url'] = build_uri('goods', array('gid'=>$row['goods_id']), $row['goods_name']);

$str.='<ul class="clearfix"><li class="goodsimg"><a href="'.$goods['url'].'" target="_blank"><img src="'.$goods['goods_thumb'].'" alt="'.$goods['goods_name'].'" class="B_blue" /></a></li><li><a href="'.$goods['url'].'" target="_blank" title="'.$goods['goods_name'].'">'.$goods['short_name'].'</a><br />'.原價:.$goods['market_price'].'<br />'.現價:.'<font class="f1">'.$goods['shop_price'].'</font><br /></li></ul>';

}

$str .= '<ul id="clear_history"><a onclick="clear_history()">' . $GLOBALS['_LANG']['clear_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, g.promote_price, g.promote_start_date, g.promote_end_date ' .

'FROM ' . $GLOBALS['ecs']->table('order_goods') . ' AS a ' .

'LEFT JOIN ' . $GLOBALS['ecs']->table('order_goods') . ' AS b ON b.order_id = a.order_id ' .

'LEFT JOIN ' . $GLOBALS['ecs']->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['_CFG']['bought_goods'];

$res = $GLOBALS['db']->query($sql);

$key = 0;

$arr = array();

while ($row = $GLOBALS['db']->fetchRow($res))

{

$arr[$key]['goods_id'] = $row['goods_id'];

$arr[$key]['goods_name'] = $row['goods_name'];

$arr[$key]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ?

sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name'];

$arr[$key]['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);

$arr[$key]['goods_img'] = get_image_path($row['goods_id'], $row['goods_img']);

$arr[$key]['shop_price'] = price_format($row['shop_price']);

$arr[$key]['market_price'] = price_format($row['market_price']);

$arr[$key]['url'] = build_uri('goods', array('gid'=>$row['goods_id']), $row['goods_name']);

if ($row['promote_price'] > 0)

{

$arr[$key]['promote_price'] = bargain_price($row['promote_price'], $row['promote_start_date'], $row['promote_end_date']);

$arr[$key]['formated_promote_price'] = price_format($arr[$key]['promote_price']);

}

else

{

$arr[$key]['promote_price'] = 0;

}

$key++;

}

return $arr;

}

然后再模板文件bought_goods.lbi 中加上

原價:{$bought_goods_data.market_price}

三、相關聯商品模塊增加市場價格:

直接打開模板文件goods_related.lbi

插入:

原價:{$releated_goods_data.market_price}

即可

以上就是本文章的內容,希望對大家有所幫助

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 国内毛片视频 | 中文字幕在线第二页 | 91精品免费在线 | 曰本三级日本三级日本三级 | 九九热精品在线视频 | 国产精品成人一区二区三区吃奶 | 在线观看免费污视频 | 精品99在线视频 | h色网站在线观看 | 久草在线观看首页 | lutube成人福利在线观看污 | 欧美成人精品欧美一级乱黄 | 国产一级大片在线观看 | 日韩视频在线一区二区三区 | 51色视频| 91天堂国产在线 | aaaaaaa毛片 | 91 在线视频观看 | 国产一级午夜 | 亚洲人成网站免费播放 | 亚洲小视频在线 | 涩涩99 | 免费人成在线播放 | 毛片电影在线看 | 免费观看高清视频网站 | 视频久久免费 | 精品久久久久久久久中文字幕 | 久草手机在线 | 一区二区三区日韩精品 | 毛片网站网址 | av成人在线电影 | 久久久麻豆| 久久久久97国产精 | 成人区精品一区二区婷婷 | 久久老司机精品视频 | hdhdhd69ⅹxxx黑人 | 国产91九色在线播放 | 国产免费永久在线观看 | aa级黄色片| 美女羞羞视频网站 | 午夜a狂野欧美一区二区 |