Jump to content

Getting category details when accessing a product via new products


Recommended Posts

Hi!

 

I have this shop (testing right now) :

http://www.african-collection.com/prestashop/

 

I'm creating a template where the header image will change for each category and the products under the same category, you can see this by going to a category and clicking in any product (for example under figures), i'm using this code in product.pl (copied from category.tpl):

 

{if $category->active}
<!-- Category image -->
{if $category->id_image}
<div class="category_image">
<img src="{$img_cat_dir}{$category->id_image}-category.jpg" alt="{$category->name}" title="{$category->name}" id="categoryImage" />
</div>
{/if}
{/if}

 

This code works fine when i enter the product via the category, but is not working when going trough viewed or new products!

 

Does anyone know the right code to use in this case?

 

Thanks!

 

Link to comment
Share on other sites

Hi! I have the solution, if someone needs it:

 


<div class="category_image">
<img src="{$img_cat_dir}{$product->id_category_default}-category.jpg" alt="categoryImage" title="categoryImage" id="categoryImage" />
</div>

 

Link to comment
Share on other sites

×
×
  • Create New...