Post by dmonco » Fri Jul 20, 2012 1:18 am

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?

New member

Posts

Joined
Sun Jun 12, 2011 8:05 am
Location - Ukraine

Post by greensolef » Fri Jul 20, 2012 1:14 pm

You have to edit your catalog/view/theme/theme-name/template/common/header.tpl file...

New member

Posts

Joined
Tue Jul 03, 2012 2:20 pm

Post by dmonco » Sun Jul 22, 2012 7:24 am

I know what I should to edit. I asked how to make this? As it's a static menu. Any solutions?

New member

Posts

Joined
Sun Jun 12, 2011 8:05 am
Location - Ukraine

Post by gabbya » Tue Sep 11, 2012 12:40 am

<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 } ?>

User avatar
New member

Posts

Joined
Sun May 06, 2012 11:39 pm

User avatar
Active Member

Posts

Joined
Fri Jun 10, 2011 8:16 pm
Who is online

Users browsing this forum: No registered users and 9 guests