OPENCART

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).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php if ($categories) { ?>
<div id="menu">
<ul>
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?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 } ?>
<!-- Adds custom button/link to the top menu -->
<li><a href="<url here>t">Title Here</a></li>
<!-- End of custom addition -->
</ul>
</div>

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!).


Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Tags

comments powered by Disqus
Page contents: