,首页增进最新上架商品
2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家
,首页增进最新上架商品 includes\lib_goods.php 最后头增进一个函数 /** * 最新上架商品 * * @accesspublic * @returnarray */ dingjian121.com baijle1663.com baiwei595.com function get_update_goods($num = '0') { $sql="SELECT goods_id, goods_name, goods_name_style, goods_thumb, shop_price, market_price, promote_price " . 'FROM ' . $GLOBALS['ecs']->table('goods')." where is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 order by goods_id desc limit $num"; $goods = $GLOBALS['db']->getAll($sql); for ($i = 0, $count = count($goods); $i < $count; $i++) { //处理赏罚促销价值 if ($goods[$i]['promote_price'] > 0) { $goods[$i]['promote_price'] = price_format($goods[$i]['promote_price']);; } else { $goods[$i]['promote_price'] = ''; } $goods[$i]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($goods[$i]['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $goods[$i]['goods_name']; $goods[$i]['url']= build_uri('goods', array('gid' => $goods[$i]['goods_id']), $goods[$i]['goods_name']); $goods[$i]['short_style_name'] = add_style($goods[$i]['short_name'], $goods[$i]['goods_name_style']); $goods[$i]['thumb'] = get_image_path($goods[$i]['goods_id'], $goods[$i]['goods_thumb'],true); $goods[$i]['shop_price'] = price_format($goods[$i]['shop_price']); $goods[$i]['market_price'] = price_format($goods[$i]['market_price']); } return $goods; } index.php 里增进一个 $smarty->assign('update_goods',get_update_goods()); 最后模板文件夹library下新建一个 update_goods.lbi -> (10) 代表商品数目 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <div class="box"> <div class="box_2 centerPadd"> <div class="itemTit" id="itemBest"> <h2>最新上架</h2> </div> <div class="clearfix goodsBox"> <!–{foreach from=get_update_goods(10) item=goods}–> <div class="goodsItem"> <span class="best"></span> <a href="{$goods.url}"><img src="{$goods.thumb}" alt="{$goods.name|escape:html}" class="goodsimg" /></a><br /> <p><a href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.short_style_name}</a></p> <font class="f1"> <!– {if $goods.promote_price neq ""} –> 促销价:{$goods.promote_price}<br /> 本店价:{$goods.shop_price}<br /> <!– {else}–> 本店价:{$goods.shop_price}<br /> 市场价:{$goods.market_price}<br /> <!–{/if}–> </font> </div> <!– { /foreach }–> <div class="more"><a href="../search.php?intro=news"><img src="images/more.gif" /></a></div> </div> </div> </div> <div class="blank5"></div> |
最近更新
常用插件
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
ecshop热门问答
ecshop热门资料
ecshop核查
ecshop收货
ecshop资源
ecshop找到你
ecshop显示
ecshop头像
ecshop注册和登录移位怎么办
ecshop鉴定
ecshopstep
ecshopaffiche
ecshop时间格式
ecshop解密
ecshop张新
ecshop增加版块
ecshopURL
ecshop链接
开网店的要求
ecshop询问
ecshop中秋月饼
ecshop中小学生
ecshop外观
ecshop询查
uchomethread
ecshop002
ecshop的操作方法
ecshop台电脑
ecshop重名
ecshop不能翻页
ecshop装机
ecshop红帽