Jump to content

How to hide subcategorie's picture in a category?


Recommended Posts

Hi,

Go to the category, then the products in that category. Delete the image to get rid of the image, or delete the product. If you only want to delete the sub category image, go to the category, then under category, find the sub category. Click on the pencil, and delete the image.

 

Hope this helps.

 

pb4sc

Link to comment
Share on other sites

  • 2 months later...

You need to edit the category.tpl file and delete the following section of code

{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}

Link to comment
Share on other sites

  • 1 year later...
  • 4 weeks later...

I solved the problem in the following manner.
Look above to remove. Subcategory photo
Now a picture emerges with "no picture available"
Search the root - img folder to C - en-default-medium_default.jpg
This is the no-picture available.jpg
Load this photo in Photoshop (or another graphics program) and make this photo completely white.
Now go to the themes folder to your own theme and choose the css folder
Here is a file named  categorie.css make the border from the inline_list li img 0px
in this way:
. inline_list li img {
border: 0px solid # ccc

The advantage of this method is that you don't need to adjust php code and if you still want a single subcat picture you just Enable this picture and it will will appear, just as the other fields are blank.
 

regards,
Ronny

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

  • 1 month later...

Hello Guys, i have the same issue but on the other way around, i've deleted the image of category (actually my developer ) and now i want to have them again, but i don't know which code i have to re-write again?

 

my store is here, Linkarta.ae

Link to comment
Share on other sites

Hello Guys, i have the same issue but on the other way around, i've deleted the image of category (actually my developer ) and now i want to have them again, but i don't know which code i have to re-write again?

 

my store is here, Linkarta.ae

 

 

just add this code:

 

{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}

to your category.tpl file there where you want to display image.

Link to comment
Share on other sites

not really, i got question mark, for all subcategories, but when I'm adding an image inn the html box of category, it;s not replacing the question mark for some reason

 

what i wanted on the first place, that i assign an image for one category only (Mother's Day Cat), but i got ? on all, so i switched off all

Link to comment
Share on other sites

this is how my t/l file look like starting line 26

 

{include file="$tpl_dir./errors.tpl"}
 
{if isset($category)}
{if $category->id AND $category->active}
 
{if $scenes || $category->description || $category->id_image}
 
<div class="content_scene_cat">
{if $scenes}
<!-- Scenes -->
{include file="$tpl_dir./scenes.tpl" scenes=$scenes}
{else}
<!-- Category image -->
 
{/if}
 
{if $category->description && 0 == 1}
<div class="cat_desc">
{if strlen($category->description) > 120}
<div id="category_description_short">{$description_short}</div>
<div id="category_description_full" style="display:none;">{$category->description}</div>
<a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a>
{else}
<div>{$category->description}</div>
{/if}
</div>
{/if}
</div>
 
{/if}
 
{if isset($subcategories) && 0 == 1}
<!-- Subcategories -->
<div id="subcategories">
{literal}<!--<h3 class="title_block"><span>{l s='Subcategories'}</span></h3>-->{/literal}
<div class="inline_list">
{foreach from=$subcategories item=subcategory name=subcategories}
{if $subcategory@iteration%4==1}
<div class="row-fluid">
{/if}
 
<div class="span3 subcategories">
<div class="subcategories-container clearfix">
<div class="img_subcate">
{*<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, 'subcat_default')|escape:'html'}" alt=""/>
{else}
<img src="{$img_cat_dir}default-subcat_default.jpg" alt="" />
{/if}
</a>*}
</div>
<div class="right_block">
<h3 class="s_title_block"><a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a></h3>
{if $subcategory.description}
<div class="cat_desc">{$subcategory.description}</div>
{/if}
</div>
</div>
</div>
{if $subcategory@iteration%4==0||$smarty.foreach.subcategories.last}
</div>
{/if}
{/foreach}
</div>
 
</div>
{/if}
 
<h1 class="title_category">
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}
{/strip}
 
<span class="resumecat category-product-count">
/ {include file="$tpl_dir./category-count.tpl"}
</span>
</h1>
 
{if $products}
<div class="content_sortPagiBar">
<div class="row-fluid sortPagiBar">
<div class="span2 hidden-phone">
<div class="inner pull-left">
<span class="title_view hidden-phone">{l s='View'} </span>
 <div class="btn-group" id="productsview">
<a class="leo_btn last" href="#" rel="view-grid"><i class="icon-th active"></i></a>
<a class="leo_btn first" href="#"  rel="view-list"><i class="icon-th-list"></i></a>
 </div>
</div>
</div>
<div class="span8 hidden-phone">
<div class="inner">
{include file="./product-sort.tpl"}
 
</div>
</div>
<div class="span2"><div class="inner">
{include file="./product-compare.tpl"}
</div></div>
</div>
</div>
{include file="./product-list.tpl" products=$products}
<div class="content_sortPagiBar bottom-compare">
<div class="sortPagiBar clearfix row-fluid">
{include file="$tpl_dir./pagination.tpl" paginationId='bottom'}
<div class="span4">
<div class="inner">
{include file="./nbr-product-page.tpl" paginationId='bottom'}
</div>
</div>
<div class="span2 pull-right">
<div class="inner">
{include file="./product-compare.tpl" paginationId='bottom'}
</div>
</div>
</div>
</div>
 
{/if}
{elseif $category->id}
<p class="warning">{l s='This category is currently unavailable.'}</p>
 
{/if}
 
 
{/if}
Link to comment
Share on other sites

  • 2 months later...

I solved the problem in the following manner.

Look above to remove. Subcategory photo

Now a picture emerges with "no picture available"

Search the root - img folder to C - en-default-medium_default.jpg

This is the no-picture available.jpg

Load this photo in Photoshop (or another graphics program) and make this photo completely white.

Now go to the themes folder to your own theme and choose the css folder

Here is a file named  categorie.css make the border from the inline_list li img 0px

in this way:

. inline_list li img {

border: 0px solid # ccc

The advantage of this method is that you don't need to adjust php code and if you still want a single subcat picture you just Enable this picture and it will will appear, just as the other fields are blank.

 

regards,

Ronny

Clever solution...do you have any idea why you would every want that "No Image Available" to show up?  Why would PrestaShop add it in the first place?

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