Post by dudumagic » Fri Feb 08, 2013 5:12 pm

How can disable the subcategories from the menu in heder ?

Code: Select all

<?php if ($categories) { ?>

<div id="menu">

  <ul>

    <?php foreach ($categories as $category) { ?>

    <li><a href="<?php echo $category['href']; ?>"><span><?php echo $category['name']; ?></span></a>

      <?php if ($category['children']) { ?>

      <div>

        <?php for ($i = 0; $i < count($category['children']);) { ?>

        <ul>

          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>

          <?php for (; $i < $j; $i++) { ?>

          <?php if (isset($category['children'][$i])) { ?>

          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>

          <?php } ?>

          <?php } ?>

        </ul>

        <?php } ?>

      </div>

      <?php } ?>

    </li>

    <?php } ?>

  </ul>

</div>

<?php } ?>

New member

Posts

Joined
Tue Sep 04, 2012 12:51 am

Post by daik01 » Fri Feb 08, 2013 10:05 pm

this would do the trick

Code: Select all

<?php if ($categories) { ?>

    <div id="menu">

      <ul>

        <?php foreach ($categories as $category) { ?>

        <li><a href="<?php echo $category['href']; ?>"><span><?php echo $category['name']; ?></span></a>

          <?php if ($category['children']) { ?>

          <div>

        <!--    <?php for ($i = 0; $i < count($category['children']);) { ?>

            <ul>

              <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>

              <?php for (; $i < $j; $i++) { ?>

              <?php if (isset($category['children'][$i])) { ?>

              <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>

              <?php } ?>

              <?php } ?>

            </ul> 

            <?php } ?> -->

          </div>

          <?php } ?>

        </li>

        <?php } ?>

      </ul>

    </div>

    <?php } ?>

TOP 5 Opencart Extensions:
1:Opencart Reservations
2:Stock Report, import/export stock levels with Excel
3:3D Carousel
4:Product Price Changer by Category
5:Set price Inclusive Taxes
DEMO SHOP


Active Member

Posts

Joined
Sun Oct 21, 2012 3:18 am

Who is online

Users browsing this forum: No registered users and 43 guests