第1步:修改 goods.php 文件
找到下面这段代码
/* 上一个商品下一个商品 */ $next_gid = $db->getOne("SELECT max(goods_id) FROM " . $ecs->table('goods') . " WHERE cat_id=".$goods['cat_id']." AND goods_id < ".$goods['goods_id'] . " AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0"); |
然后将它修改为下面代码(注意红色部分)
/* 上一个商品下一个商品 */ $next_gid = $db->getRow("SELECT goods_id,goods_name FROM " . $ecs->table('goods') . " WHERE cat_id=".$goods['cat_id']." AND goods_id < ".$goods['goods_id'] . " AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 order by goods_id desc limit 1"); |
第2步: 修改模板文件 (以官方默认模板为例) /themes/default/goods.dwt
将
<a href="{$prev_good.url}"><img alt="prev" src="./images/up.gif" /></a> |
修改为:
<a href="{$prev_good.url}"><img alt="{$prev_good.goods_name}" src="./images/up.gif" /></a> |
再将
<a href="{$next_good.url}"><img alt="next" src="./images/down.gif" /></a> |
修改为
<a href="{$next_good.url}"><img alt="{$next_good.goods_name}" src="./images/down.gif" /></a> |