Post by turboass » Thu May 18, 2017 5:35 am

Hi, im looking for the code that will loop throuh the categories and display the links.
I have put my own menu code in the header.tpl
The only categories code I could find was for the column left refering to category.tpl (I belive).


Code: Select all

<div class="list-group">
  <?php foreach ($categories as $category) { ?>
  <?php if ($category['category_id'] == $category_id) { ?>
  <a href="<?php echo $category['href']; ?>" class="list-group-item active"><?php echo $category['name']; ?></a>
  <?php if ($category['children']) { ?>
  <?php foreach ($category['children'] as $child) { ?>
  <?php if ($child['category_id'] == $child_id) { ?>
  <a href="<?php echo $child['href']; ?>" class="list-group-item active">&nbsp;&nbsp;&nbsp;- <?php echo $child['name']; ?></a>
  <?php } else { ?>
  <a href="<?php echo $child['href']; ?>" class="list-group-item">&nbsp;&nbsp;&nbsp;- <?php echo $child['name']; ?></a>
  <?php } ?>
  <?php } ?>
  <?php } ?>
  <?php } else { ?>
  <a href="<?php echo $category['href']; ?>" class="list-group-item"><?php echo $category['name']; ?></a>
  <?php } ?>
  <?php } ?>
Which results in nothing when i copy it over to my menu in the header.tpl
Any ideas?



Thu May 18, 2017 5:15 am

Post by IP_CAM » Thu May 18, 2017 7:46 am

Well, according to the M(odel)V(iew)C(ontroller)_l(anguage) OC-Scheme,
a custom_header.tpl requires to have it's corresponding custom_header.php files,
to do it's Job! :D

Ernie's OpenCart v. LIGHT + V-Pro + OpenShop Admin v.1.75 Test Sites - -

User avatar
Guru Member


Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by turboass » Sat May 20, 2017 2:20 am

Solved it after lots of hassle with cashing, which took forever to figgure out. Ended up using the php categories code already in the header instead.
Was hoping to be able to use code from left column, in case i wanted a "filter" type menu, ohh well too much hassle ill use categories I guess.

It appers there is alot of cashing going on, the chrome browser cashed the CSS file.
Opencart cashed the header.tpl at /system/storage/modification/catalog/view/theme/zodd/template/common/
even more
the extensions/modules also cashed the header file I belive, so had to disable that and refresh the cash over there as well.
:( and it seems like there are more stuff cashed at /system/storage/cache/ not sure if it did any good deliting that though.
Almost reinstalled everything.



Thu May 18, 2017 5:15 am
Who is online

Users browsing this forum: Boppe and 29 guests