Edit OpenCart template Updated on August 16, 2021 by InMotion Hosting Contributor 2 Minutes, 45 Seconds to Read In this tutorial we will show you a quick example of how you can edit a OpenCart template to change the default layout that is used for your OpenCart site. As an example let’s say you have created a gift voucher in OpenCart. By default it’s just going to show a link for customers to redeem their gift voucher at the bottom of the page in your site map. If you don’t have your categories menu at the top filled all the way up, adding a link to your gift vouchers in this menu might be handy for your customers. Edit the OpenCart header template By default when you install OpenCart all of the templates will be located in the following directory: /catalog/view/theme/default/template/ Open up the File Manager Code Editor in cPanel. Navigate to the following directory in the File Manager: /catalog/view/theme/default/template/common/ Right click on the header.tpl file and select Code Edit. If the encoding check pop-up displays, you can simply click Edit Around line 93 will be where the menu at at the top of your page completes. You’ll want to insert a link to your gift voucher page here. The link you’ll want to use should look like this: <p> <span class="code_block"></span></p> </li><li><a href="./index.php?route=account/voucher">Gift Voucher</a></li> <p> </p> <p>The section of code that you're adding this to is the <strong>DIV</strong> with the ID <strong>menu</strong>, the full code once you're done should look like this:</p> <pre> </p><div id="menu"> <p></p> <ul> <!--?php foreach ($categories as $category) { ?--> <p></p> <li><a href="<?php echo $category['href']; ?>"><!--?php echo $category['name']; ?--></a> <br> <!--?php if ($category['children']) { ?--> <div> <!--?php for ($i = 0; $i < count($category['children']);) { ?--> <p></p> <ul> <!--?php $j = $i + ceil(count($category['children']) / $category['column']); ?--><br> <!--?php for (; $i < $j; $i++) { ?--><br> <!--?php if (isset($category['children'][$i])) { ?--> <p></p> <li><a href="<?php echo $category['children'][$i]['href']; ?>"><!--?php echo $category['children'][$i]['name']; ?--></a></li> <p> <!--?php } ?--><br> <!--?php } ?--> </p></ul> <p> <!--?php } ?--> </p></div> <p> <!--?php } ?--> </p></li> <p> <!--?php } ?--><br> <strong></strong></p><strong> <li><a href="./index.php?route=account/voucher">Gift Voucher</a></li> </strong><p><strong></strong> </p></ul> </div> Once you’re done making your modification, click on Save Changes at the top right. Now you should have a nice visible link to your gift vouchers right in your top menu, instead of tucked away down in the bottom menu. Here is a before and after showing what this change accomplished: Before After Share this Article InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles Editing the Information Pages in the Footer of OpenCart My OpenCart 3 Contact Form Won’t Send Emails Resetting your OpenCart Admin Password with the Forgot Password link Using Free Cloudflare for SSL on OpenCart 1.5 Adding your store logo to your OpenCart 1.5 website Changing your Admin Password in OpenCart 1.5 Restoring a Database Backup in OpenCart 1.5 Sending Emails to Customers through OpenCart 1.5 How to Enable SSL Connection in OpenCart 1.5 Creating a 404 error page for OpenCart