{* front-end homepage*} {* show two random products from the special offers list *}

{counter name='special_offers_count' start=0 skip=1 print=false} {section name=i loop=$special_offers} {counter name=special_offers_count print=false} {/section} {counter name=special_offers_count assign="special_offers_count"} {if $special_offers_count > 1} {math equation="rand() % (maximum-1)" maximum=$special_offers_count assign="special_offers_random_index"} {math equation="(n+1)%(m-1)" n=$special_offers_random_index m=$special_offers_count assign="special_offers_random_index2"} {if $special_offers_random_index ne $special_offers_random_index2}{/if} {if $special_offers_random_index ne $special_offers_random_index2}{/if}
{$special_offers[$special_offers_random_index][1]} {$special_offers[$special_offers_random_index][3]} {$special_offers[$special_offers_random_index2][1]} {$special_offers[$special_offers_random_index2][3]}


{/if} {* end of special offers*}

{section name=i loop=$root_categories} {if $smarty.section.i.index is div by 2}{/if} {if ($smarty.section.i.index+1) is div by 2}{/if} {/section}
{$root_categories[i][1]|replace:' {$root_categories[i][1]} [{$root_categories[i][2]}]
{* show sub categories *} {assign var="tmp" value=0} {section name=j loop=$root_categories_subs} {if $root_categories_subs[j][3] == $root_categories[i][0]} {if $tmp == 1}| {else} {assign var="tmp" value=1} {/if} {$root_categories_subs[j][1]} {/if} {/section}