Hey guys,
I'm using 1.5.4 and looking to display only my subcategories and not allow the parent categories to be seen.
Is this possible? Hope you can help, cheers!
I'm using 1.5.4 and looking to display only my subcategories and not allow the parent categories to be seen.
Is this possible? Hope you can help, cheers!
open category.tpl in
catalog-->view-->theme-->yourtheme-->template-->module
change this code
with
catalog-->view-->theme-->yourtheme-->template-->module
change this code
Code: Select all
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div class="box-category">
<ul>
<?php foreach ($categories as $category) { ?>
<li>
<?php if ($category['category_id'] == $category_id) { ?>
<a href="<?php 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>
Code: Select all
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div class="box-category">
<ul>
<?php foreach ($categories as $category) { ?>
<?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 } ?>
<?php } ?>
</ul>
</div>
</div>
</div>
Sorry what I was meant to say was only show the subcategories in the category bar on the side?
http://party.7design.com.au/index.php?r ... ry&path=61
See on the left sidebar
Hire Products
Weddings
Corporate Functions
Price List
Parent
Well removing all those, and only showing
- test 1
- test 2
http://party.7design.com.au/index.php?r ... ry&path=61
See on the left sidebar
Hire Products
Weddings
Corporate Functions
Price List
Parent
Well removing all those, and only showing
- test 1
- test 2
Unfortunately I couldn't find a solution. Instead I just made them all just normal categories.
What is the reason for your needs to do this as there may be another solution...
What is the reason for your needs to do this as there may be another solution...
This is not categorymegahuman wrote:Sorry what I was meant to say was only show the subcategories in the category bar on the side?
http://party.7design.com.au/index.php?r ... ry&path=61
See on the left sidebar
Hire Products
Weddings
Corporate Functions
Price List
Parent
Well removing all those, and only showing
- test 1
- test 2
Hire Products
Weddings
Corporate Functions
Price List
The left side bar is showing all parent category. Try click the cooking Equipment. you can see what I mean.
Dear Anung,anung wrote:open category.tpl in
catalog-->view-->theme-->yourtheme-->template-->module
change this codewithCode: Select all
<div class="box"> <div class="box-heading"><?php echo $heading_title; ?></div> <div class="box-content"> <div class="box-category"> <ul> <?php foreach ($categories as $category) { ?> <li> <?php if ($category['category_id'] == $category_id) { ?> <a href="<?php 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>
Code: Select all
<div class="box"> <div class="box-heading"><?php echo $heading_title; ?></div> <div class="box-content"> <div class="box-category"> <ul> <?php foreach ($categories as $category) { ?> <?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 } ?> <?php } ?> </ul> </div> </div> </div>
Can you tell me, how to make categories name as box-heading for subcategories?
It's needed to divide subcategories for various blocks
Screen-shot:

Who is online
Users browsing this forum: No registered users and 1 guest