11 ноября 2014
{$homepage_columns = 5}
<style>
table.homepage_categories {
width: 100%;
border: none;
}
table.homepage_categories td {
width: {floor(100/$homepage_columns)}%;
padding-bottom: 20px;
}
table.homepage_categories a.top_category {
font-size: 1.5em;
}
</style>
{$categories = $wa->shop->categories(0, 1, true, true)}
<table class="homepage_categories">
{foreach $categories as $tc_id => $top_category}
    {if $tc_id is div by $homepage_columns}<tr>{/if}
    <td>
        <div class="top_category_image">
        <a class="top_category" href="{$top_category.url}">
        <img src="{shopCategoryImagesPlugin::getCategoryImageUrl($top_category.id)}" / ><br>
        {$top_category.name|escape}</a>
        </div>
        <div>{foreach $top_category.childs as $child_category name=child_categories}
        <a href="{$child_category.url}">{$child_category.name|escape}</a>
        {if !$smarty.foreach.child_categories.last}, {/if}{/foreach}
        </div>
    </td>
    {if $tc_id+1 is div by $homepage_columns}</tr>{/if}
{/foreach}
</table>