Adding Things To The Top Vertical Menu

Article by:
Date Published:
Last Modified:

One way to add a hyperlink to the top menu is to hard code it in the "catalog/view/theme/_<current theme name>_/template/common/header.tpl" file. Look for the comment in the following html code (near the bottom).

<?php if ($categories) { ?>
<div id="menu">
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php if ($category['children']) { ?>
<?php for ($i = 0; $i < count($category['children']);) { ?>
<?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 } ?>
<?php } ?>
<?php } ?>
<?php } ?>
<!-- Adds custom button/link to the top menu -->
<li><a href="<url here>t">Title Here</a></li>
<!-- End of custom addition -->

Another way is to download a free vQmod which allows you to add information pages to the menu. This can be done from the admin section of OpenCart (so no coding needed!).




comments powered by Disqus
Page contents: