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

<!--商品详情右侧  相关商品推荐-->
<!-- {if $related_goods} -->
<!--{foreach from=$related_goods item=releated_goods_data name=foo}-->
<!--{if $smarty.foreach.foo.iteration<}-->
<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:}</a>{$key}</div>
<div class="goods-a-4-price">
<!-- {if $releated_goods_data.promote_price neq } -->
{$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 } -->
{$lang.goods_number}
<strong class='color-01'>已经缺货</strong>
<!-- {elseif $goods.goods_number <= } -->
{$lang.goods_number}
<strong class='color-01'>{$goods.goods_number} {$goods.measure_unit}</strong>
<!-- {else} -->
{$lang.goods_number}
<strong class='color-01'>有货</strong>
<!-- {/if} -->
上一篇:微服务中的 API 网关(API Gateway)


下一篇:[转载]iTOP-4412开发板搭建最小linux系统