ecshop

ecshop首页调用指定商品分类下商品数量循环和css循环使用说明

ECSHOP教程 来源: ECSHOP教程网www.ecshop119.com 时间:2013-12-31 ECSHOP教程分类:ECSHOP二次开发教程

商城首页调用指定商品分类下商品数量循环和css循环使用说明

<!--{foreach from=$jcw_chajian_hot_goods_1 item=goods   name=no}-->  调用ID

{if $smarty.foreach.no.iteration < 8}  控制商品显示数量

 <li class="ecshop{$smarty.foreach.no.iteration}"> CSS循环   比如数量是 6个 CSS 效果是:ecshop1   ecshop2----ecshop6

<span class="number">{$smarty.foreach.no.iteration}</span>  循环数量显示

<h4>{$goods.name|truncate:20}</h4>控制商品名称 长度

 

{/if}
 <!--{/foreach}-->

 

 效果如下

 

 

举例2:

            <?php
$children3 = get_children($GLOBALS['smarty']->_var['goods_cat']['id']);
$GLOBALS['smarty']->assign('hotGoods3',   get_category_recommend_goods('hot', $children3));
?>

 

 <dl id="con_goods1_1" style=" display:block">
            <!--{foreach from=$hotGoods3 item=goods name=name}-->
            {if $smarty.foreach.name.iteration < 6}
            <ul class="ECSHOP show_fang_box">
             <span>{$smarty.foreach.name.iteration}</span>
              <li class="img"><a href="{$goods.url}" target="_blank" title="{$goods.name|escape:html}"><img src="{$goods.thumb}" width="60" height="60" alt="{$goods.name|escape:html}" /></a></li>
              
              <li>
                <a href="{$goods.url}" target="_blank" title="{$goods.name|escape:html}">{$goods.name|truncate:20}</a><br>
                <font class="f1">
                  <!-- {if $goods.promote_price neq ""} -->
                  {$goods.promote_price}
                  <!-- {else}-->
                  {$goods.shop_price}
                  <!--{/if}-->
                  </font>
              </li>
            </ul>
             {/if}
            <!--{/foreach}-->
            
     </dl>

转载请注明:ECSHOP模板屋-ECshop教程网https://www.ecshop119.com/ecshopjc-861.html

ECSHOP
ecshop下载 ecshop安装教程 ecshop在线演示 ecshop后台测试
ECSHOP二次开发手册
ecshop教程 ecshop二次开发 ecshop模板教程 ecshop微信配置
ECSHOP商城网站建设
ecshop空间域名 ecshop商城建设 ecshop模板修改 ecshop开发定制
ECSHOP模板屋
ecshop开发团队 ecshop开发中心 ecshop模板制作 模板屋简介
服务支持:7X24小时 151 059 55077
ECShop二次开发
ecshop搭建
qqtelcodeback_top
温馨提示

确定取消
温馨提示

关闭