Jump to content

Subcategories images change square 125x by 125x to rectangle 125x by 31x ?


Recommended Posts

Hi prestashop users can we please change the default image size off the subcategories preview images ?

 

Example this square preview image  of the subcategories is just ugly ;( http://mobile-repair.eu/en/14-iphone-repair

 

Because like it is we get a 125 by 125x square with a small rectangule picture insside

because the  original image  taken from the real categorie image  is 870x by 217x so the preview should be 125x by 31x . not a 125x square

 

Can someone please explain how to add a image size just four the subcategories images

Thank you

.

post-730936-0-21631100-1396318149_thumb.png

Edited by marcolipe (see edit history)
Link to comment
Share on other sites

Hey Marcolipe

 

You can do it like this:

 

In yourtheme/category.tpl find this code:

{if $subcategory.id_image}
    <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
    <img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if}

change to this:

{if $subcategory.id_image}
    <img class="replace-2x img-responsive" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'category_default')|escape:'html':'UTF-8'}" alt="" width="{$categorySize.width}" height="{$categorySize.height}" />
{else}
    <img class="replace-2x img-responsive" src="{$img_cat_dir}default-category_default.jpg" alt="" width="{$categorySize.width}" height="{$categorySize.height}" />
{/if}
  • Like 3
Link to comment
Share on other sites

  • 7 months later...
×
×
  • Create New...