Search code examples
prestashopcategoriesprestashop-1.6

How to implement image with link to .tpl file in prestashop


i need to add "replace" existing image with url link to prestashop category.tpl file

{if $category->id AND $category->active}
    <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, 
$category->id_image, 'category_default')|escape:'html':'UTF-8'}) 
center center no-repeat; background-size:cover; height:229px;"{else} 
style="background: transparent url(**{$content_dir}themes/{$themename}/img/demo/category_image.jpg**) no-repeat scroll center center / cover; height: 229px"{/if}>
                                    {if $category->description}

this image with link:

<a href="/ako-nakupovat-na-splatky" title="Quatro - jednoduchý nákup na splátky" target="_blank"> <img src="http://www.quatro.sk/affiliate/quatro_850x350.jpg" width="850" height="350" alt="Quatro - jednoduchý nákup na splátky" /> </a> 

Solution

  • You could remove that if statement and just have your own code in there. The original image is used as a background image though. So if you want the same image to show on all categories then you could "hardcode" it in there: