Thursday, 6 October 2016

Add a Home Button to Navbar on Opencart

For this Tutorial I will be showing you how to add a home button to your navbar, I want to add mine to the left-hand side of the bar. For this, I will be using my cPanel File Manager.

Where I want to add my home button.

You will need to find the file header.tpl, this can be found through the path public_html/catalog/view/theme/default/template/common/header.tpl. You will need to find the code <ul class="nav navbar-nav"> (on line 98), underneath this line at <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> (on line 99).

This section should now look like this:

<div class="collapse navbar-collapse navbar-ex1-collapse">
      <ul class="nav navbar-nav">
      <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
        <?php foreach ($categories as $category) { ?>
        <?php if ($category['children']) { ?>

Refresh your opencart store and it will be in your navbar, make sure it works and back up your store.

Home button added.

Sam.



0 comments:

Post a Comment