Tas Posted June 26, 2010 Share Posted June 26, 2010 Hi there,I have a question about the category tree block which I'm hoping someone can answer for me.I have a simple requirement, which is that the top level categories are not clickable. For the particular implementation of prestashop, I am building a clothing store. The top level categories consist of "Mens", "Womens", and "Accessories". Each of these contains sub-categories, which contain all of the products. The top level categories do not contain any items what-so-ever. I therefore do not want users to be able to click on these categories.It would be very nice if Prestashop added a feature which allowed you to make certain categories as "structural only" or something along those lines. That is, they exist in the category structure, but never contain products.If anyone knows of a simple way to implement this, I would be most grateful.Thanks Link to comment Share on other sites More sharing options...
rocky Posted June 27, 2010 Share Posted June 27, 2010 Try changing lines 9-13 of modules/blockcategories/blockcategories.tpl from: {if $smarty.foreach.blockCategTree.last} {include file=$branche_tpl_path node=$child last='true'} {else} {include file=$branche_tpl_path node=$child} {/if} to: {if $smarty.foreach.blockCategTree.last} {include file=$branche_tpl_path node=$child depth=1 last='true'} {else} {include file=$branche_tpl_path node=$child depth=1} {/if} then change line 2 of modules/blockcategories/category-tree-branch.tpl from: <a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{/if}{$node.name|escape:html:'UTF-8'}{if $depth > 1}{/if} to: {if $depth > 1}<a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{/if}{$node.name|escape:html:'UTF-8'}{if $depth > 1}{/if} and lines 6-10 of modules/category-tree-branch.tpl from: {if $smarty.foreach.categoryTreeBranch.last} {include file=$branche_tpl_path node=$child last='true'} {else} {include file=$branche_tpl_path node=$child last='false'} {/if} to: {if $smarty.foreach.categoryTreeBranch.last} {include file=$branche_tpl_path node=$child depth=$depth+1 last='true'} {else} {include file=$branche_tpl_path node=$child depth=$depth+1 last='false'} {/if} Link to comment Share on other sites More sharing options...
Tas Posted June 27, 2010 Author Share Posted June 27, 2010 Awesome reply.. Thank you so much. I still think it's worthwhile adding a feature to prestashop that allows you to do this without overriding the templates though.Cheers Link to comment Share on other sites More sharing options...
rocky Posted June 27, 2010 Share Posted June 27, 2010 If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now