gstar Posted March 3, 2022 Share Posted March 3, 2022 I am trying to hide the subcategories on the category page that appear ontop of the list of products (grid or list) but all I found was this article. But I cannot find this module Theme Customizer for 1.7.8.3. Any other solution? Link to comment Share on other sites More sharing options...
ComGrafPL Posted March 4, 2022 Share Posted March 4, 2022 Search for ps_categorytree ( Category tree links ) in modules. Link to comment Share on other sites More sharing options...
gstar Posted March 4, 2022 Author Share Posted March 4, 2022 1 hour ago, ComGrafPL said: Search for ps_categorytree ( Category tree links ) in modules. This is what I have here: Link to comment Share on other sites More sharing options...
ComGrafPL Posted March 4, 2022 Share Posted March 4, 2022 Change 4 to 2 or 1 and check it. ( clear cache if need it ). Link to comment Share on other sites More sharing options...
gstar Posted March 4, 2022 Author Share Posted March 4, 2022 17 minutes ago, ComGrafPL said: Change 4 to 2 or 1 and check it. ( clear cache if need it ). Have tried 2 and 1 and cleared cache but it still shows all subcategories. Link to comment Share on other sites More sharing options...
Paul C Posted March 4, 2022 Share Posted March 4, 2022 There's a switch in the default theme so yours may not have it as an option? I would look for a template called templates/catalog/_partials/subcategories.tpl (in the theme folder) and hope the theme at least follows the same convention as the classic theme.... Link to comment Share on other sites More sharing options...
gstar Posted March 4, 2022 Author Share Posted March 4, 2022 7 minutes ago, Paul C said: There's a switch in the default theme so yours may not have it as an option? I would look for a template called templates/catalog/_partials/subcategories.tpl (in the theme folder) and hope the theme at least follows the same convention as the classic theme.... I am using the classic theme. Link to comment Share on other sites More sharing options...
Paul C Posted March 4, 2022 Share Posted March 4, 2022 4 minutes ago, gstar said: I am using the classic theme. Well it's in that file then. {if !empty($subcategories)} {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) } <div id="subcategories" class="card card-block"> <h2 class="subcategory-heading">{l s='Subcategories' d='Shop.Theme.Category'}</h2> ... {/if} {/if} Not 100% sure where the variable display_subcategories is set and don't have the code to hand to check..... You could always just modify that second line to: {if (isset($display_subcategories) && $display_subcategories eq 0) || !isset($display_subcategories) } A bit of a hack but it would get it working until you solve the underlying problem.... Link to comment Share on other sites More sharing options...
gstar Posted March 4, 2022 Author Share Posted March 4, 2022 36 minutes ago, Paul C said: Not 100% sure where the variable display_subcategories is set and don't have the code to hand to check..... You could always just modify that second line to: Have set this to 0: But subcategories are still showing... Any other ideas? Link to comment Share on other sites More sharing options...
Paul C Posted March 4, 2022 Share Posted March 4, 2022 17 minutes ago, gstar said: Have set this to 0: But subcategories are still showing... Any other ideas? Not what I expected Try: {if (isset($display_subcategories) && $display_subcategories eq 0) || isset($display_subcategories) } Not sure why the variable wouldn't be set at all! Link to comment Share on other sites More sharing options...
MinnaLaa Posted March 23, 2022 Share Posted March 23, 2022 Template files (should use child theme if classic) /themes/classic/templates/catalog/listing/product_list.tpl comment away around row 38 (bold text) <!-- {block name='subcategory_list'} {if isset($subcategories) && $subcategories|@count > 0} {include file='catalog/_partials/subcategories.tpl' subcategories=$subcategories} {/if} {/block}--> Hope this solves your problem 3 2 Link to comment Share on other sites More sharing options...
gstar Posted March 28, 2022 Author Share Posted March 28, 2022 @MinnaLaayou are a genius, thank you! 1 Link to comment Share on other sites More sharing options...
Madhusudan Posted August 25, 2022 Share Posted August 25, 2022 @MinnaLaa It is not working for me. On version 1.7.8.7. Can you please help. 🙏🙏 Link to comment Share on other sites More sharing options...
MinnaLaa Posted August 27, 2022 Share Posted August 27, 2022 Without brackets? {* *} 1 Link to comment Share on other sites More sharing options...
Madhusudan Posted August 27, 2022 Share Posted August 27, 2022 17 minutes ago, MinnaLaa said: Without brackets? {* *} Thank you so much for your reply. In between I found a solution - In V.1.7.8.7 - just empty the file themes/your-theme/_partials/subcategories.tpl. Link to comment Share on other sites More sharing options...
OhmegaStar Posted June 1, 2023 Share Posted June 1, 2023 Simpler change,: {if !empty($subcategories) && 1 eq 2} Basically adding the && 1 eq 2 makes the _partial/subcategories.tpl add nothing (never becomes true, and the subcategory is removed from the catalog as requested. 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