How to hide the submenu subcategories from header menu in Opencart?

How to hide the submenu subcategories from header menu in Opencart?

How exactly to hide the submenu subcategories from the header menu in Opencart?

Some users have said that you can set order “-1” for a subcategory from the admin panel, but this method didn’t worked for me.

So I had to tweak the code from: “catalog” > “view” > “theme” > “default” > “template” > “common” > “header.tpl” (this is the path to the file if you use the default Opencart theme).

If you use a custom theme, just change the path to your custom theme header.tpl.


Look for this code in your header.tpl file:

1
2
<nav id="menu" class="navbar">
<div class="navbar-header"><span id="category" class="visible-xs"><?php echo $text_category; ?></span>

Backup your header.tpl file and start to delete lines of code that seem to be related to the submenu subcategories.

All this require some HTML knowledge, to know what code to delete.

I have made this change a long time ago and I can’t remember what exactly I deleted from there, but if you look in that file, you should easily find what tags and code you need to delete.


Once finished, re-upload your header.tpl file and check.

Do not forget, always have a backup, in case you delete extra code.

By following this tip, you should be able to know how to hide the submenu subcategories from header menu in Opencart.

If you have any questions or other methods, please leave in the comments section.

Add a comment: