ECSHOP 2.71 三步增加后台缩略图

2016-07-07 16:13 来源:www.chinab4c.com 作者:ecshop专家



效果图:


127.JPG


这种修改方法,使该缩略图不会单独占用一个格子,节省后台的空间。只有当你把鼠标放在商品名称前的图标上时,才会有该缩略图出现。


第一步:admin\includes\lib_goods.php
修改后:
$sql = "SELECT goods_id, goods_name, goods_sn, shop_price, goods_img, is_on_sale, is_best, is_new, is_hot, goods_number, integral, " .
" (promote_price > 0 AND promote_start_date <= '$today' AND promote_end_date >= '$today') AS is_promote ".
" FROM " . $GLOBALS['ecs']->table('goods') . " AS g WHERE is_delete='$is_delete' $where" .
" ORDER BY $filter[sort_by] $filter[sort_order] ".
" LIMIT " . $filter['start'] . ",$filter[page_size]";

第二步:admin\templates\goods_list.htm
(1)修改后{insert_scripts files="../js/utils.js,listtable.js,showpic.js"}
(2)修改前 <td class="first-cell" style="{if $goods.is_promote}color:red;{/if}"><span>{$goods.goods_name|escape:html}</span></td>

修改后:
<td class="first-cell" style="{if $goods.is_promote}color:red;{/if}">
<img src="images/picflag.gif"/> <span>{$goods.goods_name|escape:html}</span><div id="pic{$goods.goods_id}" style="position:absolute; width:100px; height:100px; visibility:hidden"><img src="../{$goods.goods_img}" /></div>

</td>


第三步:showpic.js 的内容

//by xushuyi
<!--
function showHideLayers() {
var p,v,obj,args=showHideLayers.arguments;
with (document) if (getElementById && ((obj=getElementById(args[0]))!=null)) { v=args[1];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible'v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->

回答:
共享的同志都要顶

请教这个JS文件放在那里啊?我都替换了好像还是有点问题~

这个JS文件能贴个文本格式的吗?
我这个好像贴上去不是很对。 我对JS又不是很懂。不知道问题出在哪里~

添加过了。