Jump to content

[solved] Missing images from the categories


Recommended Posts

Hello all,

 

I've imported product's to my shop, regenerted the thumbnails, but I'm still mising the category images. I can't figure out why...

 

For example:

 

The image appear inside the category:

http://www.growmundo...s/152-ace-seeds

 

But in the listing of categories it doesn't...

http://www.growmundo...las-femenizadas

 

Ace Seeds, the first one.

 

Can you suggest how can I fix it?

 

Thanks,

Link to comment
Share on other sites

can you paste part of the code from category.tpl file:

 

  {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')}" 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}

 

im interested in this:

 

<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

 

does the medium_default exists in your images section in back office?

Link to comment
Share on other sites

Hi,

 

Thank for the reply.

 

Medium image exist, but when I applyed a theme I deleted the "-default" (I've attached a screenshot).

post-520107-0-75109500-1364885447_thumb.jpg

 

Here is the code from category.tpl in theme folder

{* Template Prestashop BioNatural
* Copyright Prestacrea
* Author: Prestacrea
* Website: http://www.prestacrea.com *}
{include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
{if $category->id AND $category->active}
{include file="$tpl_dir./product-sort.tpl"}
 <h1 class="category_title">
  {strip}
  {$category->name|escape:'htmlall':'UTF-8'}
<span class="category-product-count">
 {include file="$tpl_dir./category-count.tpl"}
</span>
  {/strip}
 </h1>
 {if $scenes}
  <!-- Scenes -->
  {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
 {else}
  <!-- Category image -->
  <div class="category_img">
  {if $category->id_image}
<div class="align_center">
<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />
</div>
  {/if}
  {if $category->description}
<div class="cat_desc">{$category->description}</div>
  {/if}
  </div>
 {/if}
 {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, 'subcategory')}" alt="" />
  {else}
   <img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
  {/if}
 </a>
 <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}
 {if $products}
{*{include file="$tpl_dir./product-compare.tpl"}*}
{include file="$tpl_dir./product-list.tpl" products=$products}
{*{include file="$tpl_dir./product-compare.tpl"}*}
{include file="$tpl_dir./pagination.tpl"}
  {elseif !isset($subcategories)}
<p class="warning">{l s='There are no products in this category.'}</p>
  {/if}
{elseif $category->id}
 <p class="warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}

 

UPDATE: vekia, thank's a lot. I've fixed it.

Edited by turdi (see edit history)
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...