我有一个关于 smarty 和 OXID eShop 的小问题。检索一堆类别后,我尝试仅显示“排序号”特殊范围内的类别。应该显示低于 100 的所有内容。但它也显示大于 100 的项目。
这是我的代码片段:
[{foreach from=$oxcmp_categories item=ocat key=catkey name=root}]
[{if $ocat->getIsVisible() }]
[{if ((int)$ocat->oxcategories__oxsort <100) }]
[{if $smarty.foreach.root.index % 3 == 0}]
<div style="clear: left;"></div>
<div class="mainMenu sub_[{$smarty.foreach.root.index}]">
<div class="mm_header">
<p class="mm_headline">[{$ocat->oxcategories__oxtitle->value}]</p>
</div>
<div>
<img src="[{if $ocat->getThumbUrl() != ''}] [{$ocat->getThumbUrl()}] [{else}] [{'http://placehold.it/299x230'}] [{/if}]" alt="">
<p class="mm_desc">[{$ocat->oxcategories__oxdesc}]</p>
</div>
</div>
[{else}]
<div class="mainMenu sub_[{$smarty.foreach.root.index}]">
<div class="mm_header">
<p class="mm_headline">[{$ocat->oxcategories__oxtitle->value}]</p>
</div>
<div>
<img src="[{if $ocat->getThumbUrl() != ''}] [{$ocat->getThumbUrl()}] [{else}] [{'http://placehold.it/299x230'}] [{/if}]" alt="">
<p class="mm_desc">[{$ocat->oxcategories__oxdesc}]</p>
</div>
</div>
[{/if}]
[{/if}]
[{/if}]
[{/foreach}]
问题可能出在哪里?