Smarty问题与嵌套条件语句

I have a small issue regarding smarty and the OXID eShop. After retrieving a bunch of categories, I try to display only the categories within a special range of "sorting number". Everything below 100 should be displayed. But it also displays the items > 100.

Here is my code snippet:

[{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}]

Any ideas where the problem could be?

AS i found you forgot to write value in your call of sortorder. You just need to value in below line as i added, it should work.

[{if ((int)$ocat->oxcategories__oxsort->value <100) }]