Who knows how to make active menu items in the main menu?
I found many topics about how to make active Category menu but I need a solution for the Main menu: Home | Wish List (0) | My Account | Shopping Cart | Checkout
Any thoughts how to do this?
<file name="catalog/controller/common/header.php">
<operation>
<search position="after"><![CDATA[$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');]]></search>
<add><![CDATA[if (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
} else {
$parts = array();
}
if (isset($parts[0])) {
$this->data['category_id'] = $parts[0];
} else {
$this->data['category_id'] = 0;
}]]></add>
</operation>
<operation>
<search position="after"><![CDATA['name' => $category['name'],]]></search>
<add><![CDATA['category_id' => $category['category_id'],]]></add>
</operation>
<operation>
<search position="after"><![CDATA['module/currency',]]></search>
<add><![CDATA['module/gmenue',]]></add>
</operation>
</file>
hader.tpl
<?php
foreach ($categories as $category) { }
if ( $category_id == 0 ) {
echo "<li class='active_link_home'><a href='$home'> HOME </a></li>";
} else {
echo "<li><a href='$home'> Home </a></li>";
}
?>
<?php foreach ($categories as $category) { ?>
<li><?php if ($category['category_id']==$category_id) { ?>
<li class="active_link"><a href="<?php echo $category['href']; ?>" ><?php echo $category['name']; ?></a>
<?php } else { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php } ?>
<?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 } ?>
<operation>
<search position="after"><![CDATA[$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');]]></search>
<add><![CDATA[if (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
} else {
$parts = array();
}
if (isset($parts[0])) {
$this->data['category_id'] = $parts[0];
} else {
$this->data['category_id'] = 0;
}]]></add>
</operation>
<operation>
<search position="after"><![CDATA['name' => $category['name'],]]></search>
<add><![CDATA['category_id' => $category['category_id'],]]></add>
</operation>
<operation>
<search position="after"><![CDATA['module/currency',]]></search>
<add><![CDATA['module/gmenue',]]></add>
</operation>
</file>
hader.tpl
<?php
foreach ($categories as $category) { }
if ( $category_id == 0 ) {
echo "<li class='active_link_home'><a href='$home'> HOME </a></li>";
} else {
echo "<li><a href='$home'> Home </a></li>";
}
?>
<?php foreach ($categories as $category) { ?>
<li><?php if ($category['category_id']==$category_id) { ?>
<li class="active_link"><a href="<?php echo $category['href']; ?>" ><?php echo $category['name']; ?></a>
<?php } else { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php } ?>
<?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 } ?>
I have one here for free http://opencart.goleo.vn/top-active-links
or here http://www.opencart.com/index.php?route ... on_id=5870
or here http://www.opencart.com/index.php?route ... on_id=5870
GOLDEN LEOPARD SYSTEM SOLUTION
An ICT System Solution Company in Vietnam
Website: Store: http://opencart.goleo.vn or http://www.opencart.com/index.php?route ... rname=alin
Who is online
Users browsing this forum: No registered users and 9 guests