X-cart V4.7.8 Customer Head Menu

<li><a href=”javascript:;”>Eyeglasses</a>
<ul class=”dropdown”>
{foreach from=$categories_menu_list item=c}
<li><a href=”home.php?cat={$c.categoryid}”>{$c.category}{if $c.top_product_count} ({$c.top_product_count}){/if}</a>
{if $c.childs}
{foreach from=$c.childs item=sc name=sc}
{if $smarty.foreach.sc.first}<ul class=”dropdown”>{/if}
<li><a href=”home.php?cat={$sc.categoryid}”>{$sc.category}{if $sc.top_product_count} ({$sc.top_product_count}){/if}</a>
{if $sc.childs}
{foreach from=$sc.childs item=ssc name=ssc}
{if $smarty.foreach.ssc.first}<ul class=”dropdown”>{/if}
<li><a href=”home.php?cat={$ssc.categoryid}”>{$ssc.category}{if $ssc.top_product_count} ({$ssc.top_product_count}){/if}</a>
{if $ssc.childs}
{foreach from=$ssc.childs item=sssc name=sssc}
{if $smarty.foreach.sssc.first}<ul class=”dropdown”>{/if}
<li><a href=”home.php?cat={$sssc.categoryid}”>{$sssc.category}{if $sssc.top_product_count} ({$sssc.top_product_count}){/if}</a>
{if $sssc.childs}
{foreach from=$sssc.childs item=ssssc name=ssssc}
{if $smarty.foreach.ssssc.first}<ul class=”dropdown”>{/if}
<li><a href=”home.php?cat={$ssssc.categoryid}”>{$ssssc.category}{if $ssssc.top_product_count} ({$ssssc.top_product_count}){/if}</a></li>
{if $smarty.foreach.ssssc.last}</ul>{/if}
{/foreach}
{/if}
</li>
{if $smarty.foreach.sssc.last}</ul>{/if}
{/foreach}
{/if}
</li>
{if $smarty.foreach.ssc.last}</ul>{/if}
{/foreach}
{/if}
</li>
{if $smarty.foreach.sc.last}</ul>{/if}
{/foreach}
{/if}
</li>
{/foreach}
</ul>
<li>

You will get all x-cart categories and sub-categories. Demo: https://www.opticalca.com