I am trying to add the category name and link in the header.tpl for a specific category id. I have a extension installed that allows specific customer groups to access certain categories and it works and the category names/links are hidden if a customer group is not logged in and when they are logged in, they can see the category names in the menu in the header file. The client wants a link to show all the time to a specific category so non logged in members can view the category and buy products so in header.tpl I added the following code
Code: Select all
<li><a href="index.php?route=product/category&path=65">Public Shop</a></li>
But thought if they change the name of the category on the admin side and I don't know they did it, the old category name will show still so I thought if I could code in the header.tpl if a specific category id for example 65 then show the category link and category name
That way I don't have to update the name if they have changed the category name
In header.php controller file, above
Code: Select all
$categories = $this->model_catalog_category->getCategories(0);
I added
Code: Select all
$data['category_id'] = $category_id;
Then in header.tpl file I added
Code: Select all
<?php if ($category_id == '65') { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
<?php } ?>
But that didn't work, can anyone help please? I'm using 2.3.0.2. Thank you in advance