if (!empty($_COOKIE['ECS']['history']))
{
$history = explode(',', $_COOKIE['ECS']['history']);
array_unshift($history, $goods_id);
$history = array_unique($history);
while (count($history) > $_CFG['history_number'])
{
array_pop($history);
}
setcookie('ECS[history]', implode(',', $history), gmtime() + 3600 * 24 * 30);
}
else
{
setcookie('ECS[history]', $goods_id, gmtime() + 3600 * 24 * 30);
}
首先我们看下includes/lib_insert.php里面的function insert_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";
从而返回一个浏览历史记录的商品信息数组.
$str.=’- ’.$goods['short_name'].’
’.$GLOBALS['_LANG']['shop_price'].’’.$goods['shop_price'].’
’;
上面的代码就是所对应的样式代码,修改即可。
{insert name=’history’}
其中,id="history_list"是"清空"操作的ID。
$str .= '-
優惠價:'.$goods['shop_price'].'
';
标题长度控制:
$goods['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) hxrow['goods_name'];
这个语句的本意是用全局属 goods_name_length来控制长度,这个是可以在后台修改的,不过由于这个函数同时在网站的各个地方被调用,因此修改之后可能会引发其它问题,所以并不适合。
sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length'])
改为sub_str($row['goods_name'], 18,$append = true)即可。版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
转载请注明: ecshop浏览记录商品图片标题宽带长度怎么修改