rolf1 Posted March 21, 2012 Share Posted March 21, 2012 Could someone please explain to me how to hide specific categories from the blockcategories module while having them still accessible by URL? I have tried the following which I found on this forum, but it didn't work out for me. Modify modules/blockcategories/category-tree-branch.tpl and add {if $node.id != 1} to the start of the file and {/if} to the end of the file, where 1 is the id of the category you want this hide. This will hide that category and its subcategories, while making them still accessible by URL. You'll need to modify category-tree-branch.tpl in your theme's directory too so that the categories are hidden from the sitemap. Your help is much appreciated! 2 Link to comment Share on other sites More sharing options...
Prescol Posted March 26, 2012 Share Posted March 26, 2012 Do you forced compile after changed it? Link to comment Share on other sites More sharing options...
rolf88 Posted March 28, 2012 Share Posted March 28, 2012 Yes, I have tried that. Link to comment Share on other sites More sharing options...
Prescol Posted March 28, 2012 Share Posted March 28, 2012 It should work, you can try also change in the category properties: Show products=no. The category will not appear, but the products will be accessible via their links Link to comment Share on other sites More sharing options...
rolf88 Posted March 29, 2012 Share Posted March 29, 2012 Thank you for your time Prescol. Unfortunately I was not able to find the option Show products = no. Also, I think that this option is not what I'm looking for, because I would like to be able to link to the (hidden) category including all of its products instead of a single product. So, I want to have a working link to a category that does not show up in the blockcategories. Do you perhaps have any other ideas? Link to comment Share on other sites More sharing options...
Prescol Posted March 31, 2012 Share Posted March 31, 2012 Hii Rolf, i have tested the code from the first post and it works perfect This is the result code {if $node.id!=3} <li {if isset($last) && $last == 'true'}class="last"{/if}> <a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a> {if $node.children|@count > 0} <ul> {foreach from=$node.children item=child name=categoryTreeBranch} {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child last='false'} {/if} {/foreach} </ul> {/if} </li> {/if} 2 Link to comment Share on other sites More sharing options...
Marius05 Posted June 13, 2012 Share Posted June 13, 2012 (edited) Hi, i tested and is work. Dont forget to clear the cookies/cache. Or look in the folder module in yors template folder. Maybe you have the .tpl file there. Edited June 13, 2012 by Marius05 (see edit history) Link to comment Share on other sites More sharing options...
yuxi1966 Posted June 13, 2012 Share Posted June 13, 2012 So, I want to have a working link to a category that does not show up in the blockcategories. Link to comment Share on other sites More sharing options...
mrswm Posted August 8, 2012 Share Posted August 8, 2012 I have the same issue as Rolf1, as this: Modify modules/blockcategories/category-tree-branch.tpl and add {if $node.id != 1} to the start of the file and {/if} to the end of the file, where 1 is the id of the category you want this hide. This will hide that category and its subcategories, while making them still accessible by URL. You'll need to modify category-tree-branch.tpl in your theme's directory too so that the categories are hidden from the sitemap. doesn't work for me. I have tried the above, even going so far as to cutting and pasting the code provided by Prescol, and it makes no difference whatsoever - all of my categories are still appearing in the category block. I am running Prestashop 1.4.8.2, I've cleared my cookies and my cache and have force compiled. I have made the change to both the core file and to category-tree-branch.tpl in themes/mytheme/modules/blockcategories. Does anyone have any idea of what else I could try? I have tried searching the forum, and everything seems to point back to {if $node.id != 1} Thanks in advance for any help or suggestions you can provide. Link to comment Share on other sites More sharing options...
kugi Posted August 26, 2012 Share Posted August 26, 2012 Brilliant..... work perfectly (make sure you force compile, clean cache, etc) many thanks! Also make sure you have the correct id.... dont use 2 because the category is second on your menu... make sure u use the ID from the back Office..... Link to comment Share on other sites More sharing options...
mbp Posted September 14, 2012 Share Posted September 14, 2012 if I use {if $ node.id! = 3} i sholud make a new groups with id 3 But when I try to go directly to category with url. I get the following error: You do not have access to this category. Link to comment Share on other sites More sharing options...
sting5 Posted November 28, 2012 Share Posted November 28, 2012 (edited) AND for those, who want to remove subcategories pictures in the product list page - 1. go to themes/your_theme/category.tpl 2. use this code: {if isset($subcategories) && $id_category!=5 && $id_category!=6 && $id_category!=7 && $id_category!=8} the style and the description of Your subcategories picture {/if} Just change the numbers in the "&& $id_category!=[category number you want to hide]" to the ID number of your category in the catalogue at backoffice - the result: when You open the category with included number in the conditions above, You will not see the subcategories menu. I hope this will help someone! Edited November 28, 2012 by sting5 (see edit history) Link to comment Share on other sites More sharing options...
Troglobyte Posted December 15, 2012 Share Posted December 15, 2012 For those who had problems with this method, did you find a solution? I have the same issue. Thanks. Link to comment Share on other sites More sharing options...
jmthd Posted March 14, 2013 Share Posted March 14, 2013 (edited) If you want to hide multiple categories, what would that snippet of code look like? EDIT: Strike that, I found the answer on another thread: {if $node.id != 1 AND $node.id != 2} However, I'm seeing that the categories only remain hidden so long as I have caching turned off. Once I turn it back on, the categories I wanted to hide are showing again. Tried clearing cache and cookies too. Has anyone seen this? Edited March 14, 2013 by jmthd (see edit history) Link to comment Share on other sites More sharing options...
robbie007 Posted March 26, 2013 Share Posted March 26, 2013 What will the code be for multiple categories?? {if $node.id != 1 .................. Link to comment Share on other sites More sharing options...
PrestaShark Posted October 30, 2013 Share Posted October 30, 2013 Hi! I must say that this solution {if $node.id!= x} works perfectly with PS 1.5.6 too! Maybe someone know how to archieve it at categories in blocktopmenu? Because there my hiden category still apear Link to comment Share on other sites More sharing options...
Zengorius Posted September 6, 2015 Share Posted September 6, 2015 Hi everyone, my solution is here: https://www.prestashop.... Link to comment Share on other sites More sharing options...
Recommended Posts