您的位置:首页 > 运维架构

ECSHOP二次开发之首页调用团购数量方案

2012-09-17 17:25 309 查看
$row['last_amount'] = $amount_price['amount'];

1,自己改的复制上面那一断在红色的地方就可以了

/* 根据价格阶梯,计算最低价 */

$ext_info = unserialize($row['ext_info']);

$price_ladder = $ext_info['price_ladder'];

if (!is_array($price_ladder) || empty($price_ladder))

{

$row['last_price'] = price_format(0);

$row['last_amount'] = $amount_price['amount'];

}

else

{

foreach ($price_ladder AS $amount_price)

{

$price_ladder[$amount_price['amount']] = $amount_price['price'];

}

}

ksort($price_ladder);

$row['last_price'] = price_format(end($price_ladder));

$row['last_amount'] = $amount_price['amount'];

$row['url'] = build_uri('group_buy', array('gbid' => $row['group_buy_id']));

$row['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ?

sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row

['goods_name'];

$row['short_style_name'] = add_style($row['short_name'],'');

$group_buy_list[] = $row;

}

}

return $group_buy_list;

}

2,直接复制下面这一断到index.php里面,找这下面这断替换就行了。

/* 根据价格阶梯,计算最低价 */

$ext_info = unserialize($row['ext_info']);

$price_ladder = $ext_info['price_ladder'];

if (!is_array($price_ladder) || empty($price_ladder))

{

$row['last_price'] = price_format(0);

$row['last_amount'] = $amount_price['amount'];

}

else

{

foreach ($price_ladder AS $amount_price)

{

$price_ladder[$amount_price['amount']] = $amount_price['price'];

}

}

ksort($price_ladder);

$row['last_price'] = price_format(end($price_ladder));

$row['last_amount'] = $amount_price['amount'];

$row['url'] = build_uri('group_buy', array('gbid' => $row['group_buy_id']));

$row['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ?

sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row

['goods_name'];

$row['short_style_name'] = add_style($row['short_name'],'');

$group_buy_list[] = $row;

}

}

return $group_buy_list;

}

最后在首页模板里的团购商品group_buy.lbi里面加入下面这句就行了,这一句自己看要放在哪里。

{$goods.last_amount}

跟我一样模板的可以用我这断代码group_buy.lbi

<meta http-equiv="Content-Type" content="text/html; charset=gbk">

<!-- {if $group_buy_goods} -->

<h1 class="GoundTit"><div class="GoundTitTxt f_l">{$lang.group_buy_goods}</div><div class="f_r"><a href="group_buy.php">更多 >></a></div></h1>

<div class="ModelContent clearfix">

<!--{foreach from=$group_buy_goods item=goods name=groud_list}-->

<div class="ModelGoos">

<div class="imgbox">

{if $smarty.foreach.groud_list.index lt 1}

<a href="{$goods.url}"><img src="{$goods.thumb}" alt="{$goods.goods_name|escape:html}" /></a>

{else}

<a href="{$goods.url}"><img src="{$goods.thumb}" alt="{$goods.goods_name|escape:html}" class="Shmllimg" />

{/if}

</div>

<a href="{$goods.url}" title="{$goods.goods_name|escape:html}">{$goods.short_style_name|escape:html}</a><br />

{$lang.last_price}<b class="f1">{$goods.last_amount}张/{$goods.last_price}</b><br />

</div>

<!--{/foreach}-->

</div>

<!-- {/if} -->

目前还没有放上这个改完的模板,全改完在放上来,

ECSHOP SmallAppliances

这个模板的几个问题也解决得差不多了,

到时候也放上来,

修改:

首页增加友情连接

更改200*200直接用CSS控制正不是用后台缩略图改为200*200

增加多个广告位上中下。

商品树那个+号的很多人不喜欢,我自己也不喜欢也改了。

首页商品分类树改为鼠标移过去自动展开,移开就缩回去。

另一个方案是把+号改为文字“开”和"关"

点击开,商品分类树就可以实现鼠标移过去自动伸缩,点关伸缩功能就不能用。

修改了历史记录重叠现象。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: