2.7浏览历史--价格问题

2016-07-07 15:05 来源:www.chinab4c.com 作者:ecshop专家



如何让浏览历史里的商品不显示价格,或价格为0时显示与客服联系,商品列表跟内容可以该,但这个位置应该怎么该?

我修改lib_insert.php

/**
* 调用浏览历史
*
* @accesspublic
* @returnstring
*/
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 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['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 />'.$GLOBALS['_LANG']['shop_price'].'<font class="f1">'.$goods['shop_price'].'</font><br /></li></ul>';
}
$str .= '<ul id="clear_history"><a>' . $GLOBALS['_LANG']['clear_history'] . '</a></ul>';
}
return $str;
}

我把红色部分删除,但页面就不能显示了,变成空白页!!

请问该怎么做呢?

回答:
这个思路正确,再检查一下代码吧。

就是想不明白,为什么删除后,页面会显示空白~~~

啥都不显示了~~~

具体到底是哪问题啊!无奈中。。。。。。。。。。。。。。。。。。。。

请教请教啊,我应该怎么做!!

顶一下,求教解答~~

每人帮帮忙吗??

现在EC怎么那么冷清啊~~~

看了ecshop的代码,你这样删是没问题的,具体你再看看。是否是你编辑文件后,保存编码的问题。

另外,请把$res = array();这句删除。这句是没用的,官方多写了句废话。呵呵----个人意见

ding
http://www.phprm.com

OK~~
的确是保存问题~~