Jump to content

Remove Subcategories List From Category Page


Recommended Posts

Hey all - running a new install of 1.4.6.2. When a customer clicks on a category it normally lands on that category page and displays images and links of any subcategory and then all of the products below that. I want to remove that section that shows any subcategories and want it to look like a category with no subs.

 

Two attachments:

 

Remove sub shows the category that has sub cats (that I want to remove)

 

I would like it to look the same as a category with no subs (no sub cats image)

 

Thanks in advance for any assistance!

 

Joe

post-29690-0-64513800-1325540365_thumb.jpg

post-29690-0-44600300-1325540377_thumb.jpg

Link to comment
Share on other sites

If I understand correctly, this is very easy..

Remove this part of the code from category.tpl

 

{if isset($subcategories)}
 <!-- Subcategories -->
 <div id="subcategories">
  <h3>{l s='Subcategories'}</h3>
  <ul class="inline_list">
  {foreach from=$subcategories item=subcategory}
<li>
 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
  {if $subcategory.id_image}
   <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
  {else}
   <img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
  {/if}
 </a><br />
 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
</li>
  {/foreach}
  </ul>
  <br class="clear"/>
 </div>
 {/if}

  • Like 5
Link to comment
Share on other sites

If I understand correctly, this is very easy..

Remove this part of the code from category.tpl

 

{if isset($subcategories)}
 <!-- Subcategories -->
 <div id="subcategories">
  <h3>{l s='Subcategories'}</h3>
  <ul class="inline_list">
  {foreach from=$subcategories item=subcategory}
<li>
 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
  {if $subcategory.id_image}
   <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
  {else}
   <img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
  {/if}
 </a><br />
 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
</li>
  {/foreach}
  </ul>
  <br class="clear"/>
 </div>
 {/if}

 

Works great, thanks for the tip Joeri Vos.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...
  • 1 month later...

Hi

 

I am looking for another variation of this. Let me know if someone can help...

 

I need to display only some selected subcategories on the category page. So basically i want user to mark which subcategory appear on the parent category page and then based on that selection the selected subcategories appear for respective categories?

 

Please help

 

Thanks

Link to comment
Share on other sites

  • 6 months later...
  • 8 months later...

If you want remove the big one too, just put the same option there:

 

.content_scene_cat {
    padding:5px;
     display:none;
    border:1px solid #ccc;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    -moz-box-shadow: 0 1px 1px #e2e2e2;
    -webkit-box-shadow: 0 1px 1px #e2e2e2;
    box-shadow: 0 1px 1px #e2e2e2;
}

 

Link to comment
Share on other sites

  • 7 months later...

If I understand correctly, this is very easy..

Remove this part of the code from category.tpl

 

{if isset($subcategories)}
  <!-- Subcategories -->
  <div id="subcategories">
   <h3>{l s='Subcategories'}</h3>
   <ul class="inline_list">
   {foreach from=$subcategories item=subcategory}
	<li>
	 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
	  {if $subcategory.id_image}
	   <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
	  {else}
	   <img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
	  {/if}
	 </a><br />
	 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
	</li>
   {/foreach}
   </ul>
   <br class="clear"/>
  </div>
  {/if}

 

Thanks Joeri!

 

This still works in prestashop 1.6

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • 4 months later...

Hi, 

 

This is Somit and running my site http://slmobileprice.com using prestashop v1.5.6.2 english. In this version this code not available.

 

In my site i want to hide categories from center (above product page). Whenever i click on Categories their subcategories also showing on product page. So could you please tell me how to hide subcategories from the product page.. 

 

Please check screen shot.

 

Thanks,

Somit 

post-736821-0-56628100-1424418030_thumb.jpg

Link to comment
Share on other sites

  • 6 months later...

Hey everyone,

you can always hide the sub-categories from the category page directly from your themes configurator option or if that's not working for ya, here's a little module that'll hide your sub-categories in your category page. Just install and enable, if you want to show them again just disable the module. If you have any issues with the module send me a message and i'll make any changes necessary. 

 

-Best regards

 

techdancustom.zip

Edited by Guest2015 (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...

Works great, thanks for the tip Joeri Vos.

 

Didnt find the code. My .tpl code goes like this:

 

{if isset($subcategories)}
        {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }
<!-- Subcategories -->
<div id="subcategories">
<p class="subcategory-heading">{l s='Subcategories'}</p>
<ul class="clearfix">
{foreach from=$subcategories item=subcategory}
<li>
                <div class="subcategory-image">
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">
{if $subcategory.id_image}
<img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if}
 
 
and if I delete these, my whole site vanishes. 
Link to comment
Share on other sites

  • 2 months later...

I am very late in here, but just in case if someone is interested, there is a tiny little hack you can do.

 

1. Login to the database. 

2. In the configuration table, check for PS_SET_DISPLAY_SUBCATEGORIES

3. By default it is set to 1. Change it to 0.

 

This will disable all the subcategories.

 

Thanks

Kiran

Link to comment
Share on other sites

  • 3 months later...
×
×
  • Create New...