Jump to content

Hide sub categories on homepage


Recommended Posts

category.tpl

remove / comment out {* comment *}

code:
 

		{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="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{else}
							<img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{/if}
					</a>
                   	</div>
					<h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</a></h5>
					{if $subcategory.description}
						<div class="cat_desc">{$subcategory.description}</div>
					{/if}
				</li>
			{/foreach}
			</ul>
		</div>
        {/if}
		{/if}
Link to comment
Share on other sites

Hello

 

Have you tried going to:

 

public_html/Your Shop/themes/default-bootstrap/css/category.css

 

and add around line 41 display:none:

 

 

 

#subcategories {
  border-top: 1px solid #d6d4d4;
  padding: 15px 0 0px 0; }
  #subcategories p.subcategory-heading {
    font-weight: bold;
    color: #333333;
    margin: 0 0 15px 0; 
    display:none; }
  #subcategories ul {
    margin: 0 0 0 -20px; }
    #subcategories ul li {
      float: left;
      width: 128px;
      margin: 0 0 13px 20px;
      text-align: center;
      height: 202px;
      display:none;  }
      #subcategories ul li .subcategory-image {
        padding: 0 0 8px 0; }
 
Before
 
After
 
Sorry if I'm barking up the wrong tree
 
Paul
Link to comment
Share on other sites

As I said before Nemo1 - this is a totally clean installation, I have not edited or changed it at all - it is straight out of the box.

 

Paulito: I took your suggestion and did some more investigation.

 

What you suggested didnt solve the issue but this did:

 

../modules/homepagecategories/css/homepagecategories.css

 

Line 81 add display:none: here -

 

#homepagecategories .homepagecategories_subcat a { display:none; margin:0 2px; }

 

Thank you for everyones help !!!!

Link to comment
Share on other sites

  • 2 months later...

Hi, 

 

This is Somit and running my site http://slmobileprice.com using prestashop v1.5.6.2 english.

 

In my site i want to hide subcategories 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-28189100-1424417523_thumb.jpg

Link to comment
Share on other sites

Hi Nemo1,

 

 

I have Removed these code from Category.tpl file , Am i right?

 

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...