ECSHOP商品页_将上一个下一个的ALT改为商品名称

第1步:修改 goods.php 文件找到下面这段代码/* 上一个商品下一个商品 */$prev_gid = $db->getOne("SELECT 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 LIMIT 1");if (!empty($prev_gid)){$prev_good['url'] = build_uri('goods', array('gid' => $prev_gid), $goods['goods_name']);$smarty->assign('prev_good', $prev_good);//上一个商品}$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");if (!empty($next_gid)){$next_good['url'] = build_uri('goods', array('gid' => $next_gid), $goods['goods_name']);$smarty->assign('next_good', $next_good);//下一个商品}然后将它修改为下面代码(注意红色部分)/* 上一个商品下一个商品 */$prev_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 LIMIT 1");if (!empty($prev_gid)){$prev_good['url'] = build_uri('goods', array('gid' => $prev_gid['goods_id']), $goods['goods_name']);$prev_good['goods_name'] =$prev_gid['goods_name'];$smarty->assign('prev_good', $prev_good);//上一个商品}$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");if (!empty($next_gid)){$next_good['url'] = build_uri('goods', array('gid' => $next_gid['goods_id']), $goods['goods_name']);$next_good['goods_name'] =$next_gid['goods_name'];$smarty->assign('next_good', $next_good);//下一个商品}第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>下一篇: 屏蔽ecshop云提示no_license 上一篇: 在ECSHOP商品列表页显示每个商品的评论等级和评

(0)

相关推荐

  • JS实例-DOM-切换图片

    切换图片 <style>       *{          margin:0;          padding:0;       }       #outer{          wi ...

  • 周易第63卦_既济卦(水火既济)_坎上离下

    周易第63卦详解 既济卦原文 既济.亨,小利贞,初吉终乱. 象曰:水在火上,既济.君子以思患而预防之. 白话文解释 既济卦:亨通.这是小见吉利的贞卜.起初吉利,最后将发生变故. <象辞>说 ...

  • 周易第62卦_小过卦(雷山小过)_震上艮下

    周易第62卦详解 小过卦原文 小过.亨,利贞.可小事,不可大事.飞鸟遗之音.不宜上,宜下,大吉. 象曰:山上有雷,小过.君子以行过乎恭,丧过乎衰,用过乎俭. 白话文解释 小过卦:亨通,这是吉利的贞卜. ...

  • 周易第61卦_中孚卦(风泽中孚)_巽上兑下

    周易第61卦详解 中孚卦原文 中孚.豚鱼,吉.利涉大川,利贞. 象曰:泽上有风,中孚.君子以议狱缓死. 白话文解释 中孚卦:豚鱼献祭,虽物薄但心诚,吉利.并利于涉水过河.这是吉利的贞卜. <象辞 ...

  • 周易第60卦_节卦(水泽节)_坎上兑下

    周易第60卦详解 节卦原文 节.亨,苦节不可贞. 象曰:泽上有水,节.君子以制数度,议德行. 白话文解释 节卦:亨通.如果以节制为苦,其凶吉则不可卜问. <象辞>说:本卦下卦为兑,兑为泽: ...

  • 周易第59卦_涣卦(风水涣)_巽上坎下

    周易第59卦详解 涣卦原文 涣.亨,王假有庙.利涉大川,利贞. 象曰:风行水上,涣.先王以享于帝,立庙. 白话文解释 涣卦:亨通,因为君王亲临宗庙,禳灾祈福.利于涉水过江河.这是吉利的贞卜 <象 ...

  • 周易第58卦_兑卦(兑为泽)_兑上兑下

    周易第58卦详解 兑卦原文 兑.亨,利,贞. 象曰:丽泽,兑.君子以朋友讲习. 白话文解释 兑卦:亨通.吉利的贞卜. <象辞>说:本卦为两兑相叠,兑为泽,两泽相连,两水交流是兑卦的卦象.君 ...

  • 周易第56卦_旅卦(火山旅)_离上艮下

    周易第56卦详解 旅卦原文 旅.小亨,旅贞吉. 象曰:山上有火,旅.君子以明慎用刑,而不留狱. 白话文解释 旅卦:稍见亨通.贞卜旅行,吉利. <象辞>说:本卦上卦为离,离为火:下卦为艮,艮 ...

  • 周易第55卦_丰卦(雷火丰)_震上离下

    周易第55卦详解 丰卦原文 丰.亨.王假之,勿忧,宜日中. 象曰:雷电皆至,丰.君子以折狱致刑. 白话文解释 丰卦:举行祭祀,君王将亲临宗庙.不要担心,最佳时刻当在正午时分. <象辞>说: ...

  • 周易第54卦_归妹卦(雷泽归妹)_震上兑下

    周易第54卦详解 归妹卦原文 归妹.征凶,无攸利. 象曰:泽上有雷,归妹.君子以永终知敝. 白话文解释 归妹卦:筮遇此爻,出征凶险.无所利. <象辞>说:归妹之卦,下卦为兑,兑为泽:上卦为 ...