danrandon Posted December 4, 2014 Share Posted December 4, 2014 (edited) I'm looking to disable clicking on the parent category for any items that have a sub category. Is this possible? i'm using the default them btw. I'm new to prestashop and any help would be appreciated. Thanks in advance. Edited December 4, 2014 by danrandon (see edit history) Link to comment Share on other sites More sharing options...
FullCircles Posted December 4, 2014 Share Posted December 4, 2014 If it's the blockcategories module, you should be able to target them like this: In category-tree-branch.tpl Find: <a href="{$node.link|escape:'html':'UTF-8'}"{if isset($currentCategoryId) && $node.id == $currentCategoryId} class="selected"{/if} title="{$node.desc|strip_tags|trim|escape:'html':'UTF-8'}"> Change it to: <a href="{$node.link|escape:'html':'UTF-8'}"{if isset($currentCategoryId) && $node.id == $currentCategoryId} class="selected"{/if} title="{$node.desc|strip_tags|trim|escape:'html':'UTF-8'}"{if $node.children|@count > 0} onclick="javascript: return false;"{/if}> Is a nice and simple solution. There are other ways of disabling links which you could look into, such as setting disabled="disabled" or disabling pointer events via css, but I find that to be the easiest way generally, plus it doesn't break the links if javascript isn't enabled (less and less of a thing these days, admittedly) 1 Link to comment Share on other sites More sharing options...
danrandon Posted December 4, 2014 Author Share Posted December 4, 2014 You sir are a legend. Spot on. Many thanks 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