私人领地

ecshop if标签,超过N条,就输出记录 elseif、库存显示方式

 

<!--商品详情右侧  相关商品推荐-->
<!-- {if $related_goods} -->
<!--{foreach from=$related_goods item=releated_goods_data name=foo}-->
<!--{if $smarty.foreach.foo.iteration<3}-->
<div class="goods-a-4">
   <a href="{$releated_goods_data.url}"><img src="{$releated_goods_data.goods_thumb}" alt="{$releated_goods_data.goods_name}" />
    <div class="goods-a-4-text"><a href="{$releated_goods_data.url}" title="{$releated_goods_data.goods_name}">{$releated_goods_data.short_name|truncate:26}</a>{$key}</div>
    <div class="goods-a-4-price">
    <!-- {if $releated_goods_data.promote_price neq 0} -->
        {$releated_goods_data.formated_promote_price}
        <!-- {else} -->
        {$releated_goods_data.shop_price}
        <!-- {/if} -->
    </div>
</div>
<!-- {/if} -->
<!--{/foreach}-->
<!-- {/if} -->

 if  elseif   语句   库存显示方式

<!-- {if $goods.goods_number eq 0} -->
          {$lang.goods_number}
          <strong  class='color-01'>已经缺货</strong>
          <!-- {elseif  $goods.goods_number <= 10} -->
         {$lang.goods_number}
          <strong class='color-01'>{$goods.goods_number} {$goods.measure_unit}</strong>
        <!-- {else} -->
          {$lang.goods_number}
          <strong class='color-01'>有货</strong>
        <!-- {/if} -->

 

posted @ 2015-09-23 11:34  狂奔的蜗牛Snails  阅读(1633)  评论(0编辑  收藏  举报