<?php
/**
 * Copyright © 2018 Porto. All rights reserved.
 */

?>
<?php
/**
 * Top menu for store
 *
 * @see \Smartwave\Megamenu\Block\Topmenu
 */
?>
<?php
    $_helper = $this->helper('Smartwave\Megamenu\Helper\Data');
    $_config = $_helper->getConfig('sw_megamenu');
    $columnsLimit = 0;
    if($_config['general']['enable']) {
?>
<?php $_menu = $block->getMegamenuHtml(); ?>

<nav class="navigation sw-megamenu side-megamenu" role="navigation">
    <ul>
        <?php echo $_menu; ?>
    </ul>
</nav>

<script type="text/javascript">
    require([
        'jquery',
        'Smartwave_Megamenu/js/sw_megamenu'
    ], function ($) {
        $(".sw-megamenu").swMegamenu();
    });
</script>
<?php
    }
?>