ecshop的用户体验优化(一)
一、浏览历史调用商品图片
打开/includes/Lib_insert.php
1、 查找:FROM ‘ . $GLOBALS['ecs']->table(’goods’) . 跳到81行
把: $sql = ‘SELECT goods_id, goods_name FROM ‘ . $GLOBALS['ecs']->table(’goods’) .
” WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0″;
代替成:
$sql = ‘SELECT goods_id, goods_name, goods_thumb , market_price,shop_price,promote_price FROM ‘ . $GLOBALS['ecs']->table(’goods’) .
” WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0″;
2、查找: $goods_name = htmlspecialchars($res[$val]['goods_name']); 跳到95行
把:$goods_name = htmlspecialchars($res[$val]['goods_name']);
if ($goods_name)
{
$short_name = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($goods_name, $GLOBALS['_CFG']['goods_name_length']) : $goods_name;
$str .= ‘<li><a href=”‘ . build_uri(’goods’, array(’gid’ => $val), $goods_name). ‘” title=”‘ . $goods_name . ‘”>’ . $short_name . ‘</a></li>’;
}
代替成:
/修改浏览历史*/
$goods_name = htmlspecialchars($res[$val]['goods_name']);
$goods_thumb = $res[$val]['goods_thumb'];
$market_price = $res[$val]['market_price'];
$shop_price = $res[$val]['shop_price'];
$promote_price = $res[$val]['promote_price'];
if ($promote_price > 0){
$goods_price = ‘促销价:’.price_format($res[$val]['promote_price']);
}
elseif ($shop_price > 0){
$goods_price = ‘网店价:’.price_format($res[$val]['shop_price']);
}
else{
$goods_price = ‘门店价:’.price_format($res[$val]['market_price']);
}
if ($goods_name)
{
$short_name = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($goods_name, $GLOBALS['_CFG']['goods_name_length']) : $goods_name;
$str .= ‘<li><div class=”padx”><div id=”hisimg”><a href=”‘ . build_uri(’goods’, array(’gid’ => $val), $goods_name). ‘” title=”"><img src=”‘ . $goods_thumb . ‘” border=”0″ alt=”‘ . $goods_name . ‘” class=”imgleftthumb” /></div></a> <a href=”‘ . build_uri(’goods’, array(’gid’ => $val), $goods_name). ‘” title=”"> <div id=”hisinfo”>’ . $goods_name . ‘<br/>’ . $goods_price . ‘ </div></a></div></li>’;
}
/*Efog修改浏览历史080928结束*/
附加CSS控制:
.history-list {
padding: 0 0 0 0px ;
margin: 0;
list-style-type:none;
width:192px;
display:inline-table;
}
.history-list li {
width:190px;
float:left;
overflow:hidden;
}
.history-list a{color:#666666;display:block;}
.history-list a:hover{color:#0000ff;}
.history-list #hisimg{ background/: #333300; float:left;width:64px;height:64px;}
.history-list #hisinfo{padding:0 0 0 0; background/:#333300;height:float:left;}
.history-list .imgleftthumb{width:56px;height:56px;border:1px #000033 solid; }
二、注册协议的屏蔽
use.php
/* if(empty($_POST['agreement']))
{
show_message($_LANG['passport_js']['agreement']);
}*/
三、相关商品增加图片和价格
goods_related.lbi
<!– {foreach from=$related_goods item=goods_related} –>
<div class=”item”>
<p class=”pic”><a href=”{$goods_related.url}”><img src=”{$goods_related.goods_thumb}” alt=”{$goods_related.goods_name}” /></a></p>
<p class=”name”><a href=”{$goods_related.url}” title=”{$goods_related.goods_name}”>{$goods_related.short_name}</a></p>
<p class=”price”>
<!– {if $goods_related.promote_price neq 0} –>
{$lang.promote_price}<span class=”goodsPrice”>{$goods_related.formated_promote_price}</span>
<!– {else}–>
{$lang.shop_price}<span class=”goodsPrice”>{$goods_related.shop_price}</span>
<!–{/if}–>
</p>
</div><!– /item –>
<!– {/foreach} –>