Jump to content

[SOLVED]Catagory images question.


Recommended Posts

I would like the small images of my subcategories to show, but how do I make it so the main category image does NOT show when I go to view the products in that category? When I click on a subcategory, I would like to go directly to viewing the products in that category, without a category image at the top of the page. I will explain further if necessary. Thank you for any help you can provide.

Link to comment
Share on other sites

Edit /themes/prestashop/category.tpl and remove the following code (you may want to keep a backup just in case)

   {if $scenes}
       <!-- Scenes -->
       {include file=$tpl_dir./scenes.tpl scenes=$scenes}
   {else}
       <!-- Category image -->
       {if $category->id_image}
getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
       {/if}
   {/if}

Link to comment
Share on other sites

  • 5 months later...

Hi, I have the same issue...
I also want the image of the subcategory not to be shown when you go to that subcategory (subcategory page), if I delete the lines mentioned before in category.tpl this will apply for everything, even if you just have categories... how to make this work ONLY if a category has subcategories ??

Thank you!

Link to comment
Share on other sites

Change it to

   {if $scenes}
       <!-- Scenes -->
       {include file=$tpl_dir./scenes.tpl scenes=$scenes}
   {elseif  !isset($subcategories)}
       <!-- Category image -->
       {if $category->id_image}
getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
       {/if}
   {/if}

Link to comment
Share on other sites

Thank you very much for your fast response...
it didn't work, but I saw that the code is a little bit different, I'm using 1.3.3, sorry I didn't mentioned before, but I found another topic with the same issue with the following solution

at category.tpl change the line #22

from:
{if $category->id_image}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

to:
{if $category->id_image && $category->level_depth == 1}


And in case you don't want the text "There is no product" to appear after the Category name in situations wich you have Subcategories with products, change the following:

at category.tpl change the block around line #5

from:

{strip}
{$category->name|escape:'htmlall':'UTF-8'}

{if $nb_products == 0}{l s='There are no products.'}
{else}
{if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if}
{$nb_products}
{if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
{/if}
{/strip}



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
to:

{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if $nb_products > 0}

{if $nb_products == 0}{l s='There are no products.'}
{else}
{if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if}
{$nb_products}
{if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
{/if}
{/if}
{/strip}

Link to comment
Share on other sites

  • 3 years later...

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...