Learn how to create a customised OpenCart Navigation bar to choose what links your menu contains, no matter the destination!
In this blog we are going to be looking at how to customise the OpenCart navigation bar to show whatever links you want it to show. We will be setting them manually so they can even be to other websites other than the one OpenCart is installed on.
First of all you need to find the file which sets out the navigation menu template which is in the header.tpl file (incidently, for those who don’t know what a .tpl extension is, it just means “Template File”) located at:
- catalog/view/theme/[YOUR THEME]/template/common/header.tpl
The Quick Way To Add Custom Links To Your OpenCart Nav Bar
Now open up the file in your editor and find the section that looks like:
Looks like a bit of a mess but don’t be put off if you’re not that good at PHP just a little bit of HTML will get you adding in your own links. Basically this code is looking through all the product categories in your OpenCart database and adding them to the Nav bar on your website, you just need to get in the middle of that process with your own links!
Towards the end of the section you will need to put a space in the code and add your unique links to be included towards the end of the navigation bar. I have shown an example below: