ecshop手机ectouch商城首页促销商品调用方法

ectouch手机商城首页没有找到促销商品的调用方式,自己动手改了下程序,方法如下:
打开mobile\include\apps\default\controller\IndexController.class.php文件,在public function index()函数里面搜索找到如下:
// 团购商品
$this->assign('group_buy_goods', model('Groupbuy')->group_buy_list(C('page_size'),1,'goods_id','ASC'));
在以上代码下加入
// 促销商品
$this->assign('promote_goods', model('Index')->get_promote_goods());
然后修改首页模板index.dwt文件,在合适位置加入以下代码:
{if $promote_goods}
<section class="index_floor">
<div class="floor_body">
<h2><span class="title_l"></span><span class="title_r"></span>限时抢购</h2>
 <div class="bd">
 <ul>
  <!--{foreach from=$promote_goods item=goods name=promote_goods}-->
  <li>
    <a href="{$goods.url}" title="{$goods.name|escape:html}">
    <div class="products_kuang"><img src="{$option.static_path}{$goods.thumb}"></div>
    <div class="goods_name">{$goods.goods_style_name|escape:html|truncate:12}</div>
    <span class="price">{if $goods.promote_price}{$goods.promote_price}{else}{$goods.shop_price}{/if}</span></a>
  </li>
  <!--{/foreach}-->
 </ul>
 </div>
</div>
{/if}
样式自己修改吧,还可以加入促销倒计时的

本文原创地址:https://www.ecshopok.com/article-440.html
版权所有 © 转载时必须以链接形式注明出处!

觉得本文对您有用,想收藏下来!方法很简单:请点击-〉
我们一直坚持白天工作、晚上熬夜更新资源,付出了巨大的精力和时间,其中的辛酸难以言述。

文章评论

暂无评论,来发表一个吧

发表 取消
充值有惊喜 ECSHOP插件网微信客服edait_cn