How to customize OpenCart navigation bar

OpenCart is loaded with tons of features famous open source e-commerce store builder, one that lets you build your web hosting OpenCart for you to start your online store as soon as possible.

In this lesson, we have to how to customize the navigation bar in OpenCart simple way to learn.

First, you need to find the file which contains the code OpenCart navigation bar. File contains the code OpenCart menu / navigation bar of know header.tpl

Located in: catalog / view / theme / (your subject) / template /common/header.tpl

Easy way to customize your OpenCart navigation

Open header.tpl such as dream weaver, Notepad ++, or even a simple notepad in the code editor, locate the following code block:

<?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 } ?>
  </ul>
</div>
<?php } ?>

It may be something new to you, or if you are not good at PHP Web developers have less 
knowledge,  but do not worry, I will make it very easy for you to add your custom link 
OpenCart navigation menu. This code gets  OpenCart class to your menu, the current dynamic. 
You can completely customize your OpenCart  navigation bar is your desire.

To add a custom link OpenCart menu bar, the last of the code, you need to add some custom code as follows:
<?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 } ?>

 //Insert your new links here
 <li><a href="http://www.yourstore.com/factory">Our Factory</a></li>

 </ul>
</div>
<?php } ?>

This is the best and the most easiest way to customize OpenCart navigation bar. You can add as many links as you want, depending on your theme.