ECSHOP首页调用某个分类下的商品的方法和代码

调用某个分类下的商品,方法有很多种的,不过都需要先在后台设置模板那里设置显示和显示条数,
然后在需要调用的模板里放上相应的代码即可:
1、比如:
<?php $this->assign(‘cat_goods’,$this->_var[‘cat_goods_15’]); ?><?php $this->assign(‘goods_cat’,$this->_var[‘goods_cat_15’]); ?><?php echo $this->fetch(‘library/cat_goods.lbi’); ?>

上面的15就是某个要调用的栏目ID值.把它改成其他你要调用的分类ID值即可.

2、这是第二种:
          <!–{foreach from=$cat_goods_14 item=goods}–>
          <div class="xgoods">
            <div class="img"><a href="{$goods.url}" target="_blank"><img src="{$goods.thumb}" alt="{$goods.name|escape:html}" width="67" height="56" border="0" class="imgb"/></a></div>
            <div class="name"><a href="{$goods.url}" target="_blank">{$goods.short_name|escape:html|truncate:10}</a><br />
              <span class="fontr fontb fontbig">{$goods.shop_price}</span></div>
          </div>
          <!–{/foreach}–>

说明:上面的$cat_goods_14 ,其中14就是你想要调用的栏目ID值,把它改成你要调用的栏目ID值即可。

3、第三种:先在要调用的模板里设置区域,比如:
<!– TemplateBeginEditable name="某分类区域" –><!– TemplateEndEditable –>
然后在后台设置模板那里增加分类显示时选此区域即可。
 

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片
    • 头像卖墨商城0
    • 头像卖墨商城0
    • 头像Yiwu0
    • 头像Yiwu0