{"id":40751,"date":"2015-02-12T01:01:27","date_gmt":"2015-02-12T06:01:27","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=40751"},"modified":"2016-02-18T04:47:58","modified_gmt":"2016-02-18T09:47:58","slug":"opencart-1-5-x-how-to-manage-top-menu","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/opencart-1-5-x-how-to-manage-top-menu.html","title":{"rendered":"OpenCart 1.5.x. How to manage top menu"},"content":{"rendered":"<p>\r\n<\/p>\r\n<p>In this tutorial we will teach you how to edit the header links in OpenCart templates.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=w6-tCtqzzBw?width=1280&amp;height=720\" rel=\"prettyPhoto\">OpenCart. How to manage top menu<\/a><\/p>\r\n<ol>\r\n<li>\r\n<p>Go to your OpenCart installation directory on server using the FTP connection or hosting control panel.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Find the <strong>header.tpl<\/strong> file located in the  <strong>\/catalog\/view\/theme\/themeXXX\/template\/common<\/strong> folder.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Open the file with some code editor like <strong>Dreamweaver<\/strong> or <strong>Notepad++<\/strong>. You can use the editor directly on your hosting control panel as well.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Look for the class <strong>&lt;ul class=&#8221;links&#8221;&gt;<\/strong>.<\/p>\r\n<\/li>\r\n<li>\r\n<p>The links are represented by the following code:<\/p>\r\n<pre class=\"brush:php\">&lt;ul class=&quot;links&quot;&gt;<br \/>\r\n&lt;?php if (!isset($this-&gt;request-&gt;get['route'])) { $route='active'; }  else {$route='';}?&gt; &lt;li class=&quot;first&quot;&gt;&lt;a class=&quot;&lt;?php echo $route; if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;common\/home&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $home; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-home&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_home; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\r\n&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;account\/wishlist&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $wishlist; ?&gt;&quot; id=&quot;wishlist-total&quot;&gt;&lt;i class=&quot;fa fa-star&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_wishlist; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\r\n&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;account\/account&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $account; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-user&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_account; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\r\n&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;checkout\/cart&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $shopping_cart; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-shopping-cart&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_shopping_cart; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\r\n&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;checkout\/checkout&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $checkout; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-check&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_checkout; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\r\n&lt;\/ul&gt;<\/pre>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2014\/11\/code.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2014\/11\/code-300x111.jpg\" alt=\"code\" width=\"300\" height=\"111\" class=\"aligncenter size-medium wp-image-40756\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/code-300x111.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/code-150x55.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/code-1024x381.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/code.jpg 1260w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p class=\"info-box\">Note: the code may differ in some templates.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Each &#8220;&lt;li&gt;&#8221; item represents a separate menu link, for example,:<\/p>\r\n<pre class=\"brush:php\">\r\n\t&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;account\/wishlist&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $wishlist; ?&gt;&quot; id=&quot;wishlist-total&quot;&gt;&lt;i class=&quot;fa fa-star&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_wishlist; ?&gt;&lt;\/a&gt;&lt;\/li&gt;   <\/pre>\r\n<\/li>\r\n<li>\r\n<p>You can change the order of the items here, delete them or add new link. Check this tutorial to learn more how to <a target=\"_blank\" href=\"\/help\/opencart-how-to-add-a-new-content-page-and-link-it-to-a-new-menu-tab-based-on-bootstrap-templates.html\"> add a new content page and link it to a new menu tab <\/a><\/p>\r\n<\/li>\r\n<li>\r\n<p>Save your changes and refresh the front page to check the links after editing.<\/p>\r\n<p><strong>!<\/strong> Make sure to have a saved copy of the file in case any errors appear after editing it.<\/p>\r\n<\/li>\r\n<li>\r\n<p>You can edit the titles of these header links in the <strong>header.php<\/strong> file in <strong>\/catalog\/language\/your language\/common\/<\/strong> folder.<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2014\/11\/translations.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2014\/11\/translations-300x54.jpg\" alt=\"translations\" width=\"300\" height=\"54\" class=\"aligncenter size-medium wp-image-40753\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/translations-300x54.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/translations-150x27.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/translations-1024x187.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/translations.jpg 1064w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li>\r\n<p>The <strong>mobile view<\/strong> menu can be edited in the same <strong>header.tpl<\/strong> file in <strong>\/catalog\/view\/theme\/themeXXX\/template\/common<\/strong> folder on your server.<\/p>\r\n<ul>\r\n<li>\r\n<p>To find the mobile view menus, look for the HTML class <strong>&lt;div class=\u201dswipe-menu\u201d&gt;<\/strong>.<\/p>\r\n<\/li>\r\n<li>\r\n<p>The list of mobile view links includes both header and footer links:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2014\/11\/mobile_links.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2014\/11\/mobile_links-135x300.jpg\" alt=\"mobile_links\" width=\"135\" height=\"300\" class=\"aligncenter size-medium wp-image-40752\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/mobile_links-135x300.jpg 135w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/mobile_links-67x150.jpg 67w\" sizes=\"(max-width: 135px) 100vw, 135px\" \/><\/a>\r\n<\/li>\r\n<li>\r\n<p>The whole code of the links looks like this:<\/p>\r\n<pre class=\"brush:php\">\r\n&lt;div class=&quot;swipe&quot;&gt;<br \/>\t\t&lt;div class=&quot;swipe-menu&quot;&gt;<br \/>\t\t\t&lt;ul class=&quot;links&quot;&gt;<br \/>\t\t\t\t&lt;?php if (!isset($this-&gt;request-&gt;get['route'])) { $route='active'; }  else {$route='';}?&gt; &lt;li class=&quot;first&quot;&gt;&lt;a class=&quot;&lt;?php echo $route; if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;common\/home&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $home; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-home&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_home; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;account\/wishlist&quot;) {echo &quot;active&quot;;} ?&gt; wishlist-total&quot; id=&quot;wishlist-total1&quot; href=&quot;&lt;?php echo $wishlist; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-star&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_wishlist; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;account\/account&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $account; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-user&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_account; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;checkout\/cart&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $shopping_cart; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-shopping-cart&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_shopping_cart; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a class=&quot;&lt;?php if (isset($this-&gt;request-&gt;get['route']) &amp;&amp; $this-&gt;request-&gt;get['route']==&quot;checkout\/checkout&quot;) {echo &quot;active&quot;;} ?&gt;&quot; href=&quot;&lt;?php echo $checkout; ?&gt;&quot;&gt;&lt;i class=&quot;fa fa-check&quot;&gt;&lt;\/i&gt;&lt;?php echo $text_checkout; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;?php if (!$logged) { ?&gt;<br \/>\t\t\t\t&lt;?php echo $text_welcome; ?&gt;<br \/>\t\t\t\t&lt;?php } else { ?&gt;<br \/>\t\t\t\t&lt;?php echo $text_logged; ?&gt;<br \/>\t\t\t\t&lt;?php } ?&gt;<br \/>\t\t\t&lt;\/ul&gt;<br \/>\t\t\t&lt;?php echo $language; ?&gt;<br \/>\t\t\t&lt;?php echo $currency; ?&gt;<br \/>\t\t\t&lt;?php if ($informations) { ?&gt;<br \/>\t\t\t&lt;ul class=&quot;foot&quot;&gt;<br \/>\t\t\t\t&lt;?php foreach ($informations as $information) { ?&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $information['href']; ?&gt;&quot;&gt;&lt;?php echo $information['title']; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;?php } ?&gt;<br \/>\t\t\t&lt;\/ul&gt;<br \/>\t\t\t&lt;?php } ?&gt;<br \/>\t\t\t&lt;ul class=&quot;foot foot-1&quot;&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $contact; ?&gt;&quot;&gt;&lt;?php echo $text_contact; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $return; ?&gt;&quot;&gt;&lt;?php echo $text_return; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $sitemap; ?&gt;&quot;&gt;&lt;?php echo $text_sitemap; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t&lt;\/ul&gt;<br \/>\t\t\t&lt;ul class=&quot;foot foot-2&quot;&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $manufacturer; ?&gt;&quot;&gt;&lt;?php echo $text_manufacturer; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $voucher; ?&gt;&quot;&gt;&lt;?php echo $text_voucher; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $affiliate; ?&gt;&quot;&gt;&lt;?php echo $text_affiliate; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $special; ?&gt;&quot;&gt;&lt;?php echo $text_special; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t&lt;\/ul&gt;<br \/>\t\t\t&lt;ul class=&quot;foot foot-3&quot;&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $order; ?&gt;&quot;&gt;&lt;?php echo $text_order; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t\t&lt;li&gt;&lt;a href=&quot;&lt;?php echo $newsletter; ?&gt;&quot;&gt;&lt;?php echo $text_newsletter; ?&gt;&lt;\/a&gt;&lt;\/li&gt;<br \/>\t\t\t&lt;\/ul&gt;<br \/>\t\t&lt;\/div&gt;<br \/>\t&lt;\/div&gt;\t<\/pre>\r\n<\/li>\r\n<li>\r\n<p>Here you can delete or add new links or change their order.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Each link on the mobile menu has a Font Awesome icon next to it. It is added with the help of a specific class, like &lt;i class=&#8221;fa fa-home&#8221;&gt;. You can find the list of icons and their classes by going to the following <a target=\"_blank\" href= \"http:\/\/fortawesome.github.io\/Font-Awesome\/cheatsheet\/\"> link<\/a>. The version of Font icons can be checked in the <strong>\/catalog\/view\/theme\/themeXXX\/stylesheet\/font-awesome.css<\/strong> file of the template.<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2014\/11\/font.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2014\/11\/font-300x103.jpg\" alt=\"font\" width=\"300\" height=\"103\" class=\"aligncenter size-medium wp-image-40754\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/font-300x103.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/font-150x51.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/font-1024x353.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/font.jpg 1220w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li>\r\n<p>Save the file to see the changes.<\/p>\r\n<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n<p>We hope the tutorial was useful for you. Feel free to check the detailed video tutorial below:<\/p>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=w6-tCtqzzBw?width=1280&amp;height=720\" rel=\"prettyPhoto\">OpenCart. How to manage top menu<\/a>\r\n<\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>In this tutorial we will teach you how to edit the header links in OpenCart templates.<\/p>\n","protected":false},"author":78,"featured_media":43708,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1156],"tags":[627,521,571,1157,1007],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/40751"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=40751"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/40751\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/43708"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=40751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=40751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=40751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}