but I cannot find anything related to the "$categories" in the header.twig
or here is something slightly different: viewtopic.php?t=93015
or this mod, but not for version 3.x
https://www.opencart.com/index.php?rout ... n_id=26321
Inaccurate solution since the OP did not confirmed the posted solution.or here is something slightly different: viewtopic.php?t=93015
Even though the extension is not for v3.x releases, you can use the Template Switcher extension on the Marketplace to still use the TPL files rather than the default TWIG files.or this mod, but not for version 3.x
https://www.opencart.com/index.php?rout ... n_id=26321
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Example:
Code: Select all
{% if categories %}
<div class="container">
<nav id="menu" class="navbar">
<div class="navbar-header">
<span id="category" class="visible-xs">{{ text_category }}</span>
<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<i class="fa fa-bars"></i>
</button>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
{% for category in categories %}
{% if category.children %}
<li class="dropdown">
<a href="{{ category.href }}" class="dropdown-toggle" data-toggle="dropdown">{{ category.name }}</a>
<div class="dropdown-menu">
<div class="dropdown-inner">
{% for children in category.children|batch(category.children|length / category.column|round(1, 'ceil')) %}
<ul class="list-unstyled">
{% for child in children %}
<li>
<a href="{{ child.href }}">{{ child.name }}</a>
</li>
{% endfor %}
</ul>
{% endfor %}
</div>
<a href="{{ category.href }}" class="see-all">{{ text_all }}
{{ category.name }}</a>
</div>
</li>
{% else %}
<li>
<a href="{{ category.href }}">{{ category.name }}</a>
</li>
{% endif %}
{% endfor %}
<li>
<a href="https://yourlink.com">Forum</a>
</li>
</ul>
</div>
</nav>
</div>
{% endif %}
Blog free tips and tricks
Free extensions
OpenCart Tutorials
OpenCart Tutorials Youtube Video for developers
add
Code: Select all
$data['categories'][] = array(
'name' => 'NAME_OF_LINK',
'children' => array(),
'column' => 1,
'href' => 'ANY_LINK'
);
before
Code: Select all
return $this->load->view('common/menu', $data);
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: No registered users and 256 guests