Post by tmitch2008 » Sat Jun 15, 2013 7:22 pm

Hi,

I have a category list like so...

Shop by brand
1. Brand 1
2. Brand 2
3. Brand 3

Shop By Occasion
1. Occasion 1
2. Occasion 2

These are contracted by default until a user selects the headings.

When you click on the top level it goes to the Shop by Brand/Occasion page, but this is what my post is about... I don't want it to go to these pages, but just refresh tree list to open that sub category if that makes sense? How would I do this? So don't open the Shop by Brand page but just show the sub categories in the list and stay on the current page.

Here is the code I've currently got for the category.tpl file...

Code: Select all

<div id="box-category-area">
 <div class="box">
  <div class="box-heading"><span><?php echo $heading_title; ?></span></div>
  <div class="box-content">
    <ul class="box-category">
      <?php foreach ($categories as $category) { ?>
      <li>

        <?php if ($category['category_id'] == $category_id) { ?>
        <a href="<?php if($category['category_id'] == 90 || $category['category_id'] == 59){?> javascript:void();<?php }else{ echo $category['href'];} ?>" class="active"><?php echo $category['name']; ?></a>

        <?php } else { ?>
        <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
        <?php } ?>
        <?php if ($category['children']) { ?>
        <ul>
          <?php foreach ($category['children'] as $child) { ?>
          <li>
            <?php if ($child['category_id'] == $child_id) { ?>
            <a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
            <?php } else { ?>
            <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
            <?php } ?>
          </li>
          <?php } ?>
        </ul>
        <?php } ?>
      </li>
      <?php } ?>
    </ul>
  </div>
 </div>
</div>

Newbie

Posts

Joined
Wed Jun 12, 2013 10:51 pm
Who is online

Users browsing this forum: Google [Bot] and 1 guest